summaryrefslogtreecommitdiffstats
path: root/spec/unit/util
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/util')
-rwxr-xr-xspec/unit/util/command_line_spec.rb12
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