diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-12 16:14:02 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-12 16:14:02 -0700 |
| commit | 40adee4ade3a447a7397a71d76e042091bbbfbff (patch) | |
| tree | bb169ff744c7a10772a55770ef976ce4f0e82763 /spec/unit/util | |
| parent | 8778307ca33a637fe10b601ee737628f2e5f9fbf (diff) | |
| parent | 7b4d9367b391f75983868046d30928ebc8411f50 (diff) | |
Merge branch 'feature/next/6962-self-documenting-strings-actions-and-options' into next
Diffstat (limited to 'spec/unit/util')
| -rwxr-xr-x | spec/unit/util/command_line_spec.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb index ca5f0540f..6cf90475b 100755 --- a/spec/unit/util/command_line_spec.rb +++ b/spec/unit/util/command_line_spec.rb @@ -99,10 +99,11 @@ describe Puppet::Util::CommandLine do Puppet::Util.expects(:which).with('puppet-whatever').returns(nil) commandline.expects(:system).never - commandline.expects(:usage_message).returns("the usage message") - commandline.expects(:abort).with{|x| x =~ /the usage message/}.raises("stubbed abort") + text = Puppet::Faces[:help, :current].help + commandline.expects(:puts).with { |x| x =~ /Unknown Puppet subcommand/ } + commandline.expects(:puts).with text - lambda{ commandline.execute }.should raise_error('stubbed abort') + commandline.execute end end end @@ -111,6 +112,11 @@ describe Puppet::Util::CommandLine do @core_apps = %w{describe filebucket kick queue resource agent cert apply doc master} @command_line = Puppet::Util::CommandLine.new("foo", %w{ client --help whatever.pp }, @tty ) end + it "should expose available_subcommands as a class method" do + @core_apps.each do |command| + @command_line.available_subcommands.should include command + end + end it 'should be able to find all existing commands' do @core_apps.each do |command| @command_line.available_subcommands.should include command |
