summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-02 15:36:05 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-02 15:36:05 -0700
commit25ee3d62bdd6c1e835f74eb9aa5f2e03e6b570df (patch)
treedfdfe515aa34034fb285fa675a04a7e3518f91fe /spec/unit
parenta71bfa10123276b1dc96c5ef540b9fbf222c2f6d (diff)
parentb20e9779f1c60a2a2ea1ddf21b3c5e06d8f68ac4 (diff)
Merge branch 'bug/2.7.x/better-error-reporting-in-face-cli-facade' into 2.7.x
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/application/facts_spec.rb4
-rwxr-xr-xspec/unit/util/command_line_spec.rb10
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