spec/vcloud/launcher/cli_spec.rb in vcloud-launcher-0.4.0 vs spec/vcloud/launcher/cli_spec.rb in vcloud-launcher-0.5.0

- old
+ new

@@ -49,10 +49,11 @@ let(:cli_options) { { "dont-power-on" => false, "continue-on-error" => false, "quiet" => false, + "post-launch-cmd" => false, "verbose" => false, } } it_behaves_like "a good CLI command" @@ -63,10 +64,11 @@ let(:cli_options) { { "dont-power-on" => true, "continue-on-error" => false, "quiet" => false, + "post-launch-cmd" => false, "verbose" => false, } } it_behaves_like "a good CLI command" @@ -77,10 +79,11 @@ let(:cli_options) { { "dont-power-on" => false, "continue-on-error" => true, "quiet" => false, + "post-launch-cmd" => false, "verbose" => false, } } it_behaves_like "a good CLI command" @@ -91,10 +94,11 @@ let(:cli_options) { { "dont-power-on" => false, "continue-on-error" => false, "quiet" => true, + "post-launch-cmd" => false, "verbose" => false, } } it_behaves_like "a good CLI command" @@ -105,10 +109,11 @@ let(:cli_options) { { "dont-power-on" => false, "continue-on-error" => false, "quiet" => false, + "post-launch-cmd" => false, "verbose" => true, } } it_behaves_like "a good CLI command" @@ -119,14 +124,46 @@ let(:cli_options) { { "dont-power-on" => false, "continue-on-error" => true, "quiet" => false, + "post-launch-cmd" => false, "verbose" => true, } } it_behaves_like "a good CLI command" + end + + context "when asked to run a command on launch" do + let(:args) { [ config_file, "--post-launch-cmd", "GIRAFFE" ] } + let(:cli_options) { + { + "dont-power-on" => false, + "continue-on-error" => false, + "quiet" => false, + "post-launch-cmd" => 'GIRAFFE', + "verbose" => false, + } + } + + it_behaves_like "a good CLI command" + end + + context "specifying a command with arguments to run on launch" do + let(:args) { [ config_file, "--post-launch-cmd", "GIRAFFE LION" ] } + let(:cli_options) { + { + "dont-power-on" => false, + "continue-on-error" => false, + "quiet" => false, + "post-launch-cmd" => 'GIRAFFE LION', + "verbose" => false, + } + } + it "exits with a error code, because this is not supported" do + expect(subject.exitstatus).not_to eq(0) + end end context "when asked to display version" do let(:args) { %w{--version} }