[Bps-public-commit] Prophet branch, master, updated. 51be121777504879ccc884ac896c91cc8e1fe5b8

spang at bestpractical.com spang at bestpractical.com
Thu Aug 6 06:38:20 EDT 2009


The branch, master has been updated
       via  51be121777504879ccc884ac896c91cc8e1fe5b8 (commit)
      from  e1e8cd066e03b6233dedd726a1f7a2b6cff449c2 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Settings.pm     |   10 +++++-----
 t/Settings/t/database-settings-editor.t |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit 51be121777504879ccc884ac896c91cc8e1fe5b8
Author: Christine Spang <spang at bestpractical.com>
Date:   Thu Aug 6 11:38:05 2009 +0100

    Update settings tests.

diff --git a/lib/Prophet/CLI/Command/Settings.pm b/lib/Prophet/CLI/Command/Settings.pm
index 61e59d3..03d21b4 100644
--- a/lib/Prophet/CLI/Command/Settings.pm
+++ b/lib/Prophet/CLI/Command/Settings.pm
@@ -38,8 +38,7 @@ sub run {
             $done = $self->try_to_edit( template => \$template );
         }
     }
-
-    if ( $self->context->has_arg('set') ) {
+    elsif ( $self->context->has_arg('set') ) {
         for my $name ( $self->context->prop_names ) {
             my $uuid;
             if ($settings->{$name}) {
@@ -62,9 +61,10 @@ sub run {
         }
         return;
     }
-
-    print $template. "\n";
-    return;
+    else {
+        print $template. "\n";
+        return;
+    }
 }
 
 sub make_template {
diff --git a/t/Settings/t/database-settings-editor.t b/t/Settings/t/database-settings-editor.t
index d0098df..896d6f8 100644
--- a/t/Settings/t/database-settings-editor.t
+++ b/t/Settings/t/database-settings-editor.t
@@ -23,7 +23,7 @@ run_ok( 'settings', [ 'init' ] );
 my $replica_uuid = replica_uuid;
 
 # test noninteractive set
-run_output_matches( 'settings', [ 'settings', '--set', '--', 'statuses',
+run_output_matches( 'settings', [ 'settings', 'set', '--', 'statuses',
     '["new","open","stalled"]' ],
     [
         'Trying to change statuses from ["new","open","stalled","closed"] to ["new","open","stalled"].',
@@ -37,7 +37,7 @@ chomp (@valid_settings_output);
 
 run_output_matches(
     'settings',
-    [ qw/settings --show/ ],
+    [ qw/settings show/ ],
     [ @valid_settings_output ], [], "changed settings output matches"
 );
 
@@ -50,7 +50,7 @@ diag ("interactive template status will be found in $filename");
 Prophet::Test->set_editor_script("settings-editor.pl --first $filename");
 
 # then edit the settings
-run_output_matches( 'settings', [ 'settings' ],
+run_output_matches( 'settings', [ 'settings', 'edit' ],
     [
         'Changed default_status from ["new"] to ["open"].',
         'Setting with uuid "6FBD84A1-4568-48E7-B90C-F1A5B7BD8ECD" does not exist.',
@@ -66,7 +66,7 @@ chomp (@valid_settings_output);
 
 run_output_matches(
     'settings',
-    [ qw/settings --show/ ],
+    [ qw/settings show/ ],
     [ @valid_settings_output ], [], "changed settings output matches"
 );
 
@@ -75,7 +75,7 @@ my $second_filename = File::Temp->new(
     TEMPLATE => File::Spec->catfile(File::Spec->tmpdir(), '/statusXXXXX') )->filename;
 diag ("interactive template status will be found in $second_filename");
 Prophet::Test->set_editor_script("settings-editor.pl --second $second_filename");
-run_output_matches( 'settings', [ 'settings' ],
+run_output_matches( 'settings', [ 'settings', 'edit' ],
     [
         qr/^An error occured setting default_milestone to \["alpha":/,
         'Changed default_component from ["core"] to ["ui"].',

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



More information about the Bps-public-commit mailing list