[Bps-public-commit] Prophet branch, master, updated. 232063f1ad4d10c52ffd71ad1813a8a220ce917c

spang at bestpractical.com spang at bestpractical.com
Fri Aug 21 10:16:41 EDT 2009


The branch, master has been updated
       via  232063f1ad4d10c52ffd71ad1813a8a220ce917c (commit)
      from  e148ebb1d13bab27e571ce0898a14f0bcc51c35c (commit)

Summary of changes:
 t/info.t |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100644 t/info.t

- Log -----------------------------------------------------------------
commit 232063f1ad4d10c52ffd71ad1813a8a220ce917c
Author: Christine Spang <spang at bestpractical.com>
Date:   Fri Aug 21 15:06:18 2009 +0100

    Tests for info command + regression test for previous bugfix

diff --git a/t/info.t b/t/info.t
new file mode 100644
index 0000000..a6a73a1
--- /dev/null
+++ b/t/info.t
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Prophet::Test tests => 2;
+
+# tests for info command
+
+my $alice_resolution_db_uuid;
+as_alice {
+    my $cli = Prophet::CLI->new();
+    $cli->handle->initialize;
+
+    my $db_uuid = $cli->handle->db_uuid;
+    my $replica_uuid = $cli->handle->uuid;
+    $alice_resolution_db_uuid = $cli->handle->resolution_db_handle->db_uuid;
+    my $resolution_replica_uuid = $cli->handle->resolution_db_handle->uuid;
+
+    my $output = run_command( 'info' );
+    my $exp_output = qr{Records Database
+----------------
+Location:      file:///.*
+Database UUID: $db_uuid
+Replica UUID:  $replica_uuid
+Changesets:    0
+Known types:   
+
+Resolutions Database
+--------------------
+Location:      file://.*
+Database UUID: $alice_resolution_db_uuid
+Replica UUID:  $resolution_replica_uuid
+Changesets:    0
+};
+    like ($output, $exp_output, 'info command output' );
+};
+
+# regression test for 7A041904-66AB-11DD-AE9D-77633178437E
+as_bob {
+    my $cli = Prophet::CLI->new();
+    $cli->handle->initialize;
+
+    my $bob_resolution_db_uuid = $cli->handle->resolution_db_handle->db_uuid;
+
+    my (undef, $error)
+        = run_command( 'pull', '--from', repo_uri_for('alice') );
+    my $exp_error = <<"END_ERROR";
+You are trying to merge two different databases! This is NOT
+recommended. If you really want to do this,  add '--force' to
+your commandline.
+
+Local database:  $bob_resolution_db_uuid
+Remote database: $alice_resolution_db_uuid
+END_ERROR
+    is( $error, $exp_error, 'local/remote database correct in merge warning' );
+};
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list