Skip to content

Instantly share code, notes, and snippets.

@domcleal
Created November 30, 2012 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domcleal/4179351 to your computer and use it in GitHub Desktop.
Save domcleal/4179351 to your computer and use it in GitHub Desktop.
#17877 reproducer
diff --git a/spec/unit/transaction/resource_harness_spec.rb b/spec/unit/transaction/resource_harness_spec.rb
index 7e9aac4..6334d77 100755
--- a/spec/unit/transaction/resource_harness_spec.rb
+++ b/spec/unit/transaction/resource_harness_spec.rb
@@ -111,17 +111,25 @@ describe Puppet::Transaction::ResourceHarness do
describe "when an error occurs" do
before :each do
stub_provider = make_stub_provider
- resource = stub_provider.new :name => 'name', :foo => 1, :bar => 2
- resource.expects(:err).never
- @status = @harness.evaluate(resource)
+ @resource = stub_provider.new :name => 'name', :foo => 1, :bar => 2
+ @resource.expects(:err).never
end
it "should record previous successful events" do
+ @status = @harness.evaluate(@resource)
@status.events[0].property.should == 'foo'
@status.events[0].status.should == 'success'
end
it "should record a failure event" do
+ @status = @harness.evaluate(@resource)
+ @status.events[1].property.should == 'bar'
+ @status.events[1].status.should == 'failure'
+ end
+
+ it "should record a failure event with RSpec failure during sync" do
+ ZeroDivisionError.expects(:new).never()
+ @status = @harness.evaluate(@resource)
@status.events[1].property.should == 'bar'
@status.events[1].status.should == 'failure'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment