rspec-mocks 3.10.0 → 3.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +8 -0
- data/lib/rspec/mocks/proxy.rb +16 -0
- data/lib/rspec/mocks/version.rb +1 -1
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b63c6e5427e4fe32d4c7ccbd9c7ca04402e930bb1e43ae3be481b5c0389c3ca5
|
4
|
+
data.tar.gz: ad62f2cacda1d1323e16297f9c20fec673dbe1473a03a7544ce453c3e9ab360a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b499dbeef808e659763961d2a29562ad2ff1cd0de3609389320616faf0a3733dfc09e3cbf022597e0988634c08335529fb83df51c68477cd1823768a2836a1ee
|
7
|
+
data.tar.gz: f094523118689159e42323c59d174aaeb004c22da202e040394897ed40ddfcbcc5422db208fea5873d877a8187237b33c97e4a3d072da95a1b136688bb421258
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 3.10.1 / 2020-12-27
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.0...v3.10.1)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Issue `ArgumentError` rather than `TypeError` when unsupported methods on
|
7
|
+
unsupported objects are attempted to be stubbed. (@zhisme, #1357)
|
8
|
+
|
1
9
|
### 3.10.0 / 2020-10-30
|
2
10
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.9.1...v3.10.0)
|
3
11
|
|
data/lib/rspec/mocks/proxy.rb
CHANGED
@@ -21,6 +21,8 @@ module RSpec
|
|
21
21
|
|
22
22
|
# @private
|
23
23
|
def initialize(object, order_group, options={})
|
24
|
+
ensure_can_be_proxied!(object)
|
25
|
+
|
24
26
|
@object = object
|
25
27
|
@order_group = order_group
|
26
28
|
@error_generator = ErrorGenerator.new(object)
|
@@ -31,6 +33,20 @@ module RSpec
|
|
31
33
|
@method_doubles = Hash.new { |h, k| h[k] = MethodDouble.new(@object, k, self) }
|
32
34
|
end
|
33
35
|
|
36
|
+
# @private
|
37
|
+
def ensure_can_be_proxied!(object)
|
38
|
+
return unless object.is_a?(Symbol) || object.frozen?
|
39
|
+
return if object.nil?
|
40
|
+
|
41
|
+
msg = "Cannot proxy frozen objects"
|
42
|
+
if Symbol === object
|
43
|
+
msg << ". Symbols such as #{object} cannot be mocked or stubbed."
|
44
|
+
else
|
45
|
+
msg << ", rspec-mocks relies on proxies for method stubbing and expectations."
|
46
|
+
end
|
47
|
+
raise ArgumentError, msg
|
48
|
+
end
|
49
|
+
|
34
50
|
# @private
|
35
51
|
attr_reader :object
|
36
52
|
|
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.10.
|
4
|
+
version: 3.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -45,7 +45,7 @@ cert_chain:
|
|
45
45
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
46
46
|
F3MdtaDehhjC
|
47
47
|
-----END CERTIFICATE-----
|
48
|
-
date: 2020-
|
48
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -194,7 +194,7 @@ licenses:
|
|
194
194
|
- MIT
|
195
195
|
metadata:
|
196
196
|
bug_tracker_uri: https://github.com/rspec/rspec-mocks/issues
|
197
|
-
changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.10.
|
197
|
+
changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.10.1/Changelog.md
|
198
198
|
documentation_uri: https://rspec.info/documentation/
|
199
199
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
200
200
|
source_code_uri: https://github.com/rspec/rspec-mocks
|
@@ -214,8 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
|
-
rubygems_version: 3.1.
|
217
|
+
rubygems_version: 3.1.4
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
|
-
summary: rspec-mocks-3.10.
|
220
|
+
summary: rspec-mocks-3.10.1
|
221
221
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|