[Bps-public-commit] r14246 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 17 22:38:15 EDT 2008


Author: sartak
Date: Thu Jul 17 22:38:13 2008
New Revision: 14246

Added:
   Prophet/trunk/t/publish-pull.t
Modified:
   Prophet/trunk/   (props changed)

Log:
 r64539 at onn:  sartak | 2008-07-17 22:37:51 -0400
 Add basic tests for publish and pull


Added: Prophet/trunk/t/publish-pull.t
==============================================================================
--- (empty file)
+++ Prophet/trunk/t/publish-pull.t	Thu Jul 17 22:38:13 2008
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Prophet::Test tests => 6;
+use Test::Exception;
+use File::Temp 'tempdir';
+use Path::Class;
+
+my $alice_published = tempdir(CLEANUP => 1);
+
+as_alice {
+    run_ok( 'prophet', [qw(create --type Bug -- --status new --from alice )], "Created a record as alice" );
+    run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
+
+    run_ok( 'prophet', [qw(publish --to), $alice_published] );
+};
+
+my $alice_uuid = database_uuid_for('alice');
+my $path = dir($alice_published)->file($alice_uuid);
+
+as_bob {
+    run_ok( 'prophet', ['pull', '--from', "file:$path", '--force'] );
+    run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
+};
+
+TODO: {
+    local $TODO = "force currently required because db_uuid generation happens too early";
+    as_charlie {
+        run_ok( 'prophet', ['pull', '--from', "file:$path"] );
+    };
+};
+



More information about the Bps-public-commit mailing list