rspec-mocks 2.14.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Changelog.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
### 2.14.2 Development
|
2
|
+
[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.14.1...2-14-maintenance)
|
3
|
+
|
4
|
+
### 2.14.1 / 2013-07-07
|
5
|
+
[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.14.0...v2.14.1)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Restore `double.as_null_object` behavior from 2.13 and earlier: a
|
10
|
+
double's nullness persisted between examples in earlier examples.
|
11
|
+
While this is not an intended use case (test doubles are meant to live
|
12
|
+
for only one example), we don't want to break behavior users rely
|
13
|
+
on in a minor relase. This will be deprecated in 2.99 and removed
|
14
|
+
in 3.0. (Myron Marston)
|
15
|
+
|
1
16
|
### 2.14.0 / 2013-07-06
|
2
17
|
[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.14.0.rc1...v2.14.0)
|
3
18
|
|
@@ -72,6 +87,14 @@ Deprecations
|
|
72
87
|
(Jon Rowe).
|
73
88
|
* Deprecate `at_least(0).times` and `any_number_of_times` (Michi Huber).
|
74
89
|
|
90
|
+
### 2.13.1 / 2013-04-06
|
91
|
+
[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.13.0...v2.13.1)
|
92
|
+
|
93
|
+
Bug fixes
|
94
|
+
|
95
|
+
* Allow a block implementation to be used in combination with
|
96
|
+
`and_yield`, `and_raise`, `and_return` or `and_throw` (Myron Marston).
|
97
|
+
|
75
98
|
### 2.13.0 / 2013-02-23
|
76
99
|
[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.12.2...v2.13.0)
|
77
100
|
|
@@ -27,12 +27,13 @@ module RSpec
|
|
27
27
|
# are declared, they'll work as expected. If not, the receiver is
|
28
28
|
# returned.
|
29
29
|
def as_null_object
|
30
|
+
@__null_object = true
|
30
31
|
__mock_proxy.as_null_object
|
31
32
|
end
|
32
33
|
|
33
34
|
# Returns true if this object has received `as_null_object`
|
34
35
|
def null_object?
|
35
|
-
|
36
|
+
@__null_object
|
36
37
|
end
|
37
38
|
|
38
39
|
# This allows for comparing the mock to other objects that proxy such as
|
@@ -62,12 +63,16 @@ module RSpec
|
|
62
63
|
|
63
64
|
# @private
|
64
65
|
def __build_mock_proxy
|
65
|
-
Proxy.new(self, @name, @options || {})
|
66
|
+
proxy = Proxy.new(self, @name, @options || {})
|
67
|
+
proxy.as_null_object if null_object?
|
68
|
+
proxy
|
66
69
|
end
|
67
70
|
|
68
71
|
private
|
69
72
|
|
70
73
|
def __initialize_as_test_double(name=nil, stubs_and_options={})
|
74
|
+
@__null_object = false
|
75
|
+
|
71
76
|
if name.is_a?(Hash) && stubs_and_options.empty?
|
72
77
|
stubs_and_options = name
|
73
78
|
@name = nil
|
data/lib/rspec/mocks/version.rb
CHANGED
@@ -88,6 +88,13 @@ module RSpec
|
|
88
88
|
# returns an int value from #to_int.
|
89
89
|
expect(("%i" % @double)).to eq("0")
|
90
90
|
end
|
91
|
+
|
92
|
+
it "preserves its nullness to subsequent examples to " +
|
93
|
+
"maintain compatibility with <= 2.13" do
|
94
|
+
RSpec::Mocks.teardown
|
95
|
+
expect(@double).to be_null_object
|
96
|
+
expect { @double.some.long.message.chain }.not_to raise_error
|
97
|
+
end
|
91
98
|
end
|
92
99
|
|
93
100
|
describe "#as_null_object" do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.14.
|
5
|
+
version: 2.14.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Steven Baker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-07-
|
13
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- features/spies/spy_unstubbed_method.feature
|
143
143
|
- features/step_definitions/additional_cli_steps.rb
|
144
144
|
- features/support/env.rb
|
145
|
+
- features/support/rubinius.rb
|
145
146
|
- features/test_frameworks/test_unit.feature
|
146
147
|
- spec/rspec/mocks/and_call_original_spec.rb
|
147
148
|
- spec/rspec/mocks/and_yield_spec.rb
|
@@ -213,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
214
|
version: '0'
|
214
215
|
segments:
|
215
216
|
- 0
|
216
|
-
hash:
|
217
|
+
hash: 947550533951590931
|
217
218
|
none: false
|
218
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
220
|
requirements:
|
@@ -222,14 +223,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
223
|
version: '0'
|
223
224
|
segments:
|
224
225
|
- 0
|
225
|
-
hash:
|
226
|
+
hash: 947550533951590931
|
226
227
|
none: false
|
227
228
|
requirements: []
|
228
229
|
rubyforge_project: rspec
|
229
230
|
rubygems_version: 1.8.24
|
230
231
|
signing_key:
|
231
232
|
specification_version: 3
|
232
|
-
summary: rspec-mocks-2.14.
|
233
|
+
summary: rspec-mocks-2.14.1
|
233
234
|
test_files:
|
234
235
|
- features/README.md
|
235
236
|
- features/Scope.md
|
@@ -267,6 +268,7 @@ test_files:
|
|
267
268
|
- features/spies/spy_unstubbed_method.feature
|
268
269
|
- features/step_definitions/additional_cli_steps.rb
|
269
270
|
- features/support/env.rb
|
271
|
+
- features/support/rubinius.rb
|
270
272
|
- features/test_frameworks/test_unit.feature
|
271
273
|
- spec/rspec/mocks/and_call_original_spec.rb
|
272
274
|
- spec/rspec/mocks/and_yield_spec.rb
|