rspec-mocks 3.4.0 → 3.4.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
  SHA1:
3
- metadata.gz: e618d7a28b9f934cf906f40a9d1c70d59833ac36
4
- data.tar.gz: 6e4a6af3c8ad439a596350088869b5cd2dd69885
3
+ metadata.gz: d5ce50f9bdd93d8059872838e7c1e042cd456633
4
+ data.tar.gz: 2d50dc301a35c6f6ed05593c3da8461c987e3e7d
5
5
  SHA512:
6
- metadata.gz: e14baa4517cc30d218b50b8bc4b3bfaa2a878504e4de3bb90c1a6f36db05d742f5d7f5c561c732031c932d4c27fbc2cc67fd471992e6ca50c3c13219d26c6c60
7
- data.tar.gz: bfe1b8654f29fc1f891e23ec4efadd1f10c1411b166fe66e0889d6336cee57d4f2ddbb7bf5becc9d0b5f6a47915d9d1fe1fc86abae394e70b9308aa8cabbe3f2
6
+ metadata.gz: 9db8f83c7c1422db6ec35b2a8503ffa44ff0f78892f9ea0b48ff75aed54ed0637965b25d421df0839c8f29ce54d15d45b6e56e6172dff6a66a0e65721891f755
7
+ data.tar.gz: 4fea4235e7df0352398356da94dbf6dedfc8abd6aa7db284ebb41cbdb7881067b8d2155ac7a3ccba5a5e5b47019e8c1450a0eab03f7538906b4c2bee2458dc72
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ ### 3.4.1 / 2016-01-10
2
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.0...v3.4.1)
3
+
4
+ Bug Fixes:
5
+
6
+ * Fix `any_instance` to work properly on Ruby 2.3. (Joe Rafaniello, #1043)
7
+
1
8
  ### 3.4.0 / 2015-11-11
2
9
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.2...v3.4.0)
3
10
 
@@ -18,6 +18,7 @@ module RSpec
18
18
  @stubs = Hash.new { |hash, key| hash[key] = [] }
19
19
  @observed_methods = []
20
20
  @played_methods = {}
21
+ @backed_up_method_owner = {}
21
22
  @klass = klass
22
23
  @expectation_set = false
23
24
  end
@@ -190,9 +191,9 @@ module RSpec
190
191
  return unless @klass.instance_method(method_name).owner == @klass
191
192
 
192
193
  alias_method_name = build_alias_method_name(method_name)
193
- @klass.class_exec do
194
+ @klass.class_exec(@backed_up_method_owner) do |backed_up_method_owner|
194
195
  remove_method method_name
195
- alias_method method_name, alias_method_name
196
+ alias_method method_name, alias_method_name if backed_up_method_owner[method_name.to_sym] == self
196
197
  remove_method alias_method_name
197
198
  end
198
199
  end
@@ -204,10 +205,13 @@ module RSpec
204
205
  end
205
206
 
206
207
  def backup_method!(method_name)
208
+ return unless public_protected_or_private_method_defined?(method_name)
209
+
207
210
  alias_method_name = build_alias_method_name(method_name)
211
+ @backed_up_method_owner[method_name.to_sym] ||= @klass.instance_method(method_name).owner
208
212
  @klass.class_exec do
209
213
  alias_method alias_method_name, method_name
210
- end if public_protected_or_private_method_defined?(method_name)
214
+ end
211
215
  end
212
216
 
213
217
  def public_protected_or_private_method_defined?(method_name)
@@ -54,6 +54,7 @@ module RSpec
54
54
  def stash
55
55
  return unless method_defined_directly_on_klass?
56
56
  @original_method ||= ::RSpec::Support.method_handle_for(@object, @method)
57
+ @klass.__send__(:undef_method, @method)
57
58
  end
58
59
 
59
60
  # @private
@@ -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.4.0'
6
+ STRING = '3.4.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.4.0
4
+ version: 3.4.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: 2015-11-12 00:00:00.000000000 Z
48
+ date: 2016-01-10 00:00:00.000000000 Z
49
49
  dependencies:
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec-support
@@ -212,6 +212,6 @@ rubyforge_project:
212
212
  rubygems_version: 2.2.2
213
213
  signing_key:
214
214
  specification_version: 4
215
- summary: rspec-mocks-3.4.0
215
+ summary: rspec-mocks-3.4.1
216
216
  test_files: []
217
217
  has_rdoc:
metadata.gz.sig CHANGED
Binary file