diff options
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/application/facts_spec.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/util/command_line_spec.rb | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/spec/unit/application/facts_spec.rb b/spec/unit/application/facts_spec.rb index aed042675..2981dc805 100755 --- a/spec/unit/application/facts_spec.rb +++ b/spec/unit/application/facts_spec.rb @@ -11,8 +11,8 @@ describe Puppet::Application::Facts do subject.command_line.stubs(:args).returns %w{find} expect { expect { subject.run }.to exit_with 1 - }.to have_printed /1 argument expected but 0 given/ - @logs.first.to_s.should =~ /1 argument expected but 0 given/ + }.to have_printed /err: puppet facts find takes 1 argument, but you gave 0/ + @logs.first.to_s.should =~ /puppet facts find takes 1 argument, but you gave 0/ end it "should return facts if a key is given to find" do diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb index 81612ee5c..d60bbb198 100755 --- a/spec/unit/util/command_line_spec.rb +++ b/spec/unit/util/command_line_spec.rb @@ -1,7 +1,7 @@ #!/usr/bin/env rspec require 'spec_helper' - +require 'puppet/face' require 'puppet/util/command_line' describe Puppet::Util::CommandLine do @@ -98,11 +98,9 @@ describe Puppet::Util::CommandLine do Puppet::Util.expects(:which).with('puppet-whatever').returns(nil) commandline.expects(:system).never - text = Puppet::Face[:help, :current].help - commandline.expects(:puts).with { |x| x =~ /Unknown Puppet subcommand/ } - commandline.expects(:puts).with text - - commandline.execute + expect { + commandline.execute + }.to have_printed(/Unknown Puppet subcommand 'whatever'/) end end end |
