spec/bogus/double_spec.rb in bogus-0.0.3.rc.1 vs spec/bogus/double_spec.rb in bogus-0.0.3.rc.2
- old
+ new
@@ -7,9 +7,19 @@
mock(double_tracker).track(object)
double.stub.foo("a", "b") { "the result" }
end
+ it "does not track existence of the double if verify fails" do
+ stub(verifies_stub_definition).verify!(object, :foo, ["a", "b"]) { raise NameError }
+
+ expect {
+ double.stub.foo("a", "b") { "the result" }
+ }.to raise_error
+
+ double_tracker.should_not have_received.track(object)
+ end
+
it "verifies stub definition" do
mock(verifies_stub_definition).verify!(object, :foo, ["a", "b"])
double.stub.foo("a", "b") { "the result" }
end