summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-04 17:33:12 -0500
committerLuke Kanies <luke@madstop.com>2008-07-04 17:33:12 -0500
commit196494a63eafc495224c1bfea933740fad7d76f0 (patch)
tree0c4a949c90de11ab0d45c7e1218e6ee9b73b0da0 /spec
parent7a6ae299621a16fa7fd8ab0fbd2c05fe723cffa4 (diff)
downloadpuppet-196494a63eafc495224c1bfea933740fad7d76f0.tar.gz
puppet-196494a63eafc495224c1bfea933740fad7d76f0.tar.xz
puppet-196494a63eafc495224c1bfea933740fad7d76f0.zip
Fixed #1231 - Exceptions during startup should now be clear.
This will often result in duplicate information, but at least the information will now always be there. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/util/settings.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb
index de6d6457c..2a3c2afc7 100755
--- a/spec/unit/util/settings.rb
+++ b/spec/unit/util/settings.rb
@@ -696,11 +696,17 @@ describe Puppet::Util::Settings do
@settings.reuse
end
- it "should fail if any resources fail" do
+ it "should fail with an appropriate message if any resources fail" do
stub_transaction
@trans.expects(:any_failed?).returns(true)
+ report = mock 'report'
+ @trans.expects(:report).returns report
- proc { @settings.use(:whatever) }.should raise_error(RuntimeError)
+ log = mock 'log', :to_s => "My failure", :level => :err
+ report.expects(:logs).returns [log]
+
+ @settings.expects(:raise).with { |msg| msg.include?("My failure") }
+ @settings.use(:whatever)
end
after { Puppet::Type.allclear }