diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-07-26 13:03:59 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-07-26 13:03:59 -0700 |
| commit | 4857ac928ccf1bd56d513eae201b57b12dd14a38 (patch) | |
| tree | 3ab71a6160b48e270ff3e483c1a4ebab7fa1e29c /spec | |
| parent | dd97d7b054df5dd1d36f32387ddf30afeefad769 (diff) | |
| parent | 778127d0c3cf01701d227ec88a8e5e6550638c35 (diff) | |
| download | puppet-4857ac928ccf1bd56d513eae201b57b12dd14a38.tar.gz puppet-4857ac928ccf1bd56d513eae201b57b12dd14a38.tar.xz puppet-4857ac928ccf1bd56d513eae201b57b12dd14a38.zip | |
Merge branch 'ticket/2.7.x/maint-show_help_for_cert_without_subcommand' into 2.7.x
* ticket/2.7.x/maint-show_help_for_cert_without_subcommand:
maint: Fix cert app to print help and exit if no subcommand
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/application/cert_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/application/cert_spec.rb b/spec/unit/application/cert_spec.rb index 7510f0783..300234c2b 100755 --- a/spec/unit/application/cert_spec.rb +++ b/spec/unit/application/cert_spec.rb @@ -208,5 +208,15 @@ describe Puppet::Application::Cert, :'fails_on_ruby_1.9.2' => true do args.should == ["fun.example.com"] end end + + it "should print help and exit if there is no subcommand" do + args = [] + @cert_app.command_line.stubs(:args).returns(args) + @cert_app.stubs(:help).returns("I called for help!") + @cert_app.expects(:puts).with("I called for help!") + + expect { @cert_app.parse_options }.to exit_with 0 + @cert_app.subcommand.should be_nil + end end end |
