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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a31e7a6d767908477670b8a92d2d8ec2d6e170441caed3fdca032ab679a48823
4
- data.tar.gz: 4de03ad5013551b8dfd17c68808df8353610907d4df35e9d0d795a0c56e3cfd7
3
+ metadata.gz: b63c6e5427e4fe32d4c7ccbd9c7ca04402e930bb1e43ae3be481b5c0389c3ca5
4
+ data.tar.gz: ad62f2cacda1d1323e16297f9c20fec673dbe1473a03a7544ce453c3e9ab360a
5
5
  SHA512:
6
- metadata.gz: 5035b0ce8fc5a4ddf37c7495fe72dbb75543efc706eef5c4b022c3eafb918bc79761b8060ebed43a9d89a5d18359334b63cf24b538d8e853e73fbb3609734168
7
- data.tar.gz: fb4974a5e0c9c9bb00818d5e083aa9061448c372e0ee6a76d30df37f59abe08def5d240c45967b07861fce2bf6d8e89d6a0b6b50fe0c46beec5b9b7c9faa67b2
6
+ metadata.gz: b499dbeef808e659763961d2a29562ad2ff1cd0de3609389320616faf0a3733dfc09e3cbf022597e0988634c08335529fb83df51c68477cd1823768a2836a1ee
7
+ data.tar.gz: f094523118689159e42323c59d174aaeb004c22da202e040394897ed40ddfcbcc5422db208fea5873d877a8187237b33c97e4a3d072da95a1b136688bb421258
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
 
@@ -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
 
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec mocks.
4
4
  module Version
5
5
  # Version of RSpec mocks currently in use in SemVer format.
6
- STRING = '3.10.0'
6
+ STRING = '3.10.1'
7
7
  end
8
8
  end
9
9
  end
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.0
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-10-30 00:00:00.000000000 Z
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.0/Changelog.md
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.3
217
+ rubygems_version: 3.1.4
218
218
  signing_key:
219
219
  specification_version: 4
220
- summary: rspec-mocks-3.10.0
220
+ summary: rspec-mocks-3.10.1
221
221
  test_files: []
metadata.gz.sig CHANGED
Binary file