rspec-mocks 3.0.1 → 3.0.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +25 -1
- data/lib/rspec/mocks/configuration.rb +1 -1
- data/lib/rspec/mocks/message_expectation.rb +11 -0
- data/lib/rspec/mocks/space.rb +2 -2
- data/lib/rspec/mocks/test_double.rb +6 -2
- data/lib/rspec/mocks/verifying_double.rb +7 -5
- data/lib/rspec/mocks/verifying_proxy.rb +1 -1
- data/lib/rspec/mocks/version.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1bc4975e669df2055273dea6d7d5408f8fdb7c8
|
4
|
+
data.tar.gz: 1c8ed12a97b2da9679629fd7e5d13cf9653fae8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50b72cd647cca2f11399a0449a552bcfba4573239a61182a5820443695f29bcba5a332083ffbcb42e56b0a45dcb103c26a85aff9acfe81f2f49710c8b8486b1
|
7
|
+
data.tar.gz: 229af01a4b572a4eded313234f40d650f674f7ceb0b162210d7187a58861fd3c971d1bca5423185733f188ae8454c7053dde5009dc899010a84a00a6f3b43807
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
### 3.0.
|
1
|
+
### 3.0.2 / 2014-06-19
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.1...v3.0.2)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Fix edge case that triggered "can't add a new key into hash during
|
7
|
+
iteration" during mock verification. (Sam Phippen, Myron Marston, #711)
|
8
|
+
* Fix verifying doubles so that when they accidentally leak into another
|
9
|
+
example, they provide the same clear error message that normal doubles
|
10
|
+
do. (Myron Marston, #718)
|
11
|
+
* Make `ordered` work with exact receive counts. (Sam Phippen, #713)
|
12
|
+
|
13
|
+
### 3.0.1 / 2014-06-07
|
2
14
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.0...v3.0.1)
|
3
15
|
|
4
16
|
Bug Fixes:
|
@@ -215,6 +227,18 @@ Bug Fixes:
|
|
215
227
|
returns `nil` or `''` so that you still get a useful message.
|
216
228
|
(Nick DeLuca)
|
217
229
|
|
230
|
+
### 2.99.1 / 2014-06-12
|
231
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.0...v2.99.1)
|
232
|
+
|
233
|
+
Bug Fixes:
|
234
|
+
|
235
|
+
* Fix bug that caused errors at the end of each example
|
236
|
+
when a `double.as_null_object` had been frozen. (Yuji Nakayama, #698)
|
237
|
+
|
238
|
+
Deprecations:
|
239
|
+
|
240
|
+
* Deprecate freezing a test double. (Yuji Nakayama, #698)
|
241
|
+
|
218
242
|
### 2.99.0 / 2014-06-01
|
219
243
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.0.rc1...v2.99.0)
|
220
244
|
|
@@ -59,6 +59,7 @@ module RSpec
|
|
59
59
|
@argument_list_matcher = ArgumentListMatcher::MATCH_ALL
|
60
60
|
@order_group = expectation_ordering
|
61
61
|
@order_group.register(self) unless type == :stub
|
62
|
+
@expectation_type = type
|
62
63
|
@ordered = false
|
63
64
|
@at_least = @at_most = @exactly = nil
|
64
65
|
@args_to_yield = []
|
@@ -438,10 +439,20 @@ module RSpec
|
|
438
439
|
# expect(api).to receive(:finish).ordered
|
439
440
|
def ordered(&block)
|
440
441
|
self.inner_implementation_action = block
|
442
|
+
additional_expected_calls.times do
|
443
|
+
@order_group.register(self)
|
444
|
+
end
|
441
445
|
@ordered = true
|
442
446
|
self
|
443
447
|
end
|
444
448
|
|
449
|
+
# @private
|
450
|
+
def additional_expected_calls
|
451
|
+
return 0 if @expectation_type == :stub || !@exactly
|
452
|
+
@expected_received_count - 1
|
453
|
+
end
|
454
|
+
|
455
|
+
|
445
456
|
# @private
|
446
457
|
def ordered?
|
447
458
|
@ordered
|
data/lib/rspec/mocks/space.rb
CHANGED
@@ -65,7 +65,7 @@ module RSpec
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def verify_all
|
68
|
-
proxies.
|
68
|
+
proxies.values.each { |proxy| proxy.verify }
|
69
69
|
any_instance_recorders.each_value { |recorder| recorder.verify }
|
70
70
|
end
|
71
71
|
|
@@ -148,7 +148,7 @@ module RSpec
|
|
148
148
|
def proxy_not_found_for(id, object)
|
149
149
|
proxies[id] = case object
|
150
150
|
when NilClass then ProxyForNil.new(@expectation_ordering)
|
151
|
-
when TestDouble then object.
|
151
|
+
when TestDouble then object.__build_mock_proxy_unless_expired(@expectation_ordering)
|
152
152
|
when Class
|
153
153
|
if RSpec::Mocks.configuration.verify_partial_doubles?
|
154
154
|
VerifyingPartialClassDoubleProxy.new(self, object, @expectation_ordering)
|
@@ -53,8 +53,8 @@ module RSpec
|
|
53
53
|
end
|
54
54
|
|
55
55
|
# @private
|
56
|
-
def
|
57
|
-
__raise_expired_error or
|
56
|
+
def __build_mock_proxy_unless_expired(order_group)
|
57
|
+
__raise_expired_error or __build_mock_proxy(order_group)
|
58
58
|
end
|
59
59
|
|
60
60
|
# @private
|
@@ -111,6 +111,10 @@ module RSpec
|
|
111
111
|
::RSpec::Mocks.space.proxy_for(self)
|
112
112
|
end
|
113
113
|
|
114
|
+
def __build_mock_proxy(order_group)
|
115
|
+
TestDoubleProxy.new(self, order_group, @name)
|
116
|
+
end
|
117
|
+
|
114
118
|
def __raise_expired_error
|
115
119
|
return false unless @__expired
|
116
120
|
ErrorGenerator.new(self, @name).raise_expired_test_double_error
|
@@ -88,6 +88,13 @@ module RSpec
|
|
88
88
|
include TestDouble
|
89
89
|
include VerifyingDouble
|
90
90
|
|
91
|
+
def as_stubbed_const(options = {})
|
92
|
+
ConstantMutator.stub(@doubled_module.const_to_replace, self, options)
|
93
|
+
self
|
94
|
+
end
|
95
|
+
|
96
|
+
private
|
97
|
+
|
91
98
|
def initialize(doubled_module, *args)
|
92
99
|
@doubled_module = doubled_module
|
93
100
|
super(doubled_module.description, *args)
|
@@ -99,11 +106,6 @@ module RSpec
|
|
99
106
|
ObjectMethodReference
|
100
107
|
)
|
101
108
|
end
|
102
|
-
|
103
|
-
def as_stubbed_const(options = {})
|
104
|
-
ConstantMutator.stub(@doubled_module.const_to_replace, self, options)
|
105
|
-
self
|
106
|
-
end
|
107
109
|
end
|
108
110
|
|
109
111
|
# Similar to an InstanceVerifyingDouble, except that it verifies against
|
data/lib/rspec/mocks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
|
34
34
|
muA=
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2014-06-
|
36
|
+
date: 2014-06-20 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: rspec-support
|
@@ -179,6 +179,6 @@ rubyforge_project: rspec
|
|
179
179
|
rubygems_version: 2.2.2
|
180
180
|
signing_key:
|
181
181
|
specification_version: 4
|
182
|
-
summary: rspec-mocks-3.0.
|
182
|
+
summary: rspec-mocks-3.0.2
|
183
183
|
test_files: []
|
184
184
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|