This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ Breaking Changes for 3.0.0:
11
11
leaving ` double(name, methods) ` for creating test doubles. (Sam Phippen)
12
12
* Remove ` any_number_of_times ` since ` should_receive(:msg).any_number_of_times `
13
13
is really a stub in a mock's clothing. (Sam Phippen)
14
+ * Remove support for re-using the same null-object test double in multiple
15
+ examples. Test doubles are designed to only live for one example.
16
+ (Myron Marston)
14
17
15
18
### 2.14.0 / 2013-07-06
16
19
[ full changelog] ( http://github.com/rspec/rspec-mocks/compare/v2.14.0.rc1...v2.14.0 )
Original file line number Diff line number Diff line change @@ -88,6 +88,17 @@ module Mocks
88
88
# returns an int value from #to_int.
89
89
expect ( ( "%i" % @double ) ) . to eq ( "0" )
90
90
end
91
+
92
+ it "does not allow null-ness to persist between examples" do
93
+ RSpec ::Mocks . teardown
94
+
95
+ expect ( @double ) . not_to be_null_object
96
+ expect { @double . some . long . message . chain } . to raise_error ( RSpec ::Mocks ::MockExpectationError )
97
+
98
+ @double . as_null_object
99
+ expect ( @double ) . to be_null_object
100
+ expect { @double . some . long . message . chain } . not_to raise_error
101
+ end
91
102
end
92
103
93
104
describe "#as_null_object" do
You can’t perform that action at this time.
0 commit comments