rspec-expectations 3.8.3 → 3.8.4

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: 35a04d20c51a45fbf58b5bf8ccdcd5d86f4e2c106aee9906afd3d3bb8e417b62
4
- data.tar.gz: 3c8218a13a68549fc5df77a74584d87fa71d954058f61bd1710bc8aeeddc2bfd
3
+ metadata.gz: c3287d393bfe1d8bb47a19be373b09d965c86541f96844a6ee20666eac8e3b22
4
+ data.tar.gz: 498320228bbe272e0b1c41e86f15b3c434e418c0c3d1f5afcb3630e6f450cdaf
5
5
  SHA512:
6
- metadata.gz: f196ef51fc2f48e4d5dd5a685b0847f797c5ef8e0de9b294873dbcadbcb2f2fb1574ef1662052f2e127083195a149ae604a95f5725cd879f912d586be2b37d8f
7
- data.tar.gz: 93a6786e1205e5baddad562b0162de3452b9659a73f7a566e40a1c7c7b93d60637b64db27a366056b93a1a6187436feddd3a0eb80507ed69a37b8a6747bc23e2
6
+ metadata.gz: cc82b0fde107519cd587adc48435e9cdd11d563bae144a4a45ac78b625eb0ea36bad76a7c0d7cfb4514d81d78f9029087b76ef4a89cd208f0610c53ee0a887e4
7
+ data.tar.gz: 2b5c42079a2f100d9ce9b0e6046b392350df1064977d4a56c78696459deecd279ab85a3b9d5b392828d60b44ba0aad1de9ee320c5bcb040d4bcf7bd079756c5f
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,5 +1,10 @@
1
- ### Development
2
- [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.3...3-8-maintenance)
1
+ ### 3.8.4 / 2019-06-10
2
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.3...v3.8.4)
3
+
4
+ Bug Fixes:
5
+
6
+ * Prevent false negatives when checking objects for the methods required to run the
7
+ the `be_an_instance_of` and `be_kind_of` matchers. (Nazar Matus, #1112)
3
8
 
4
9
  ### 3.8.3 / 2019-04-20
5
10
  [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.2...v3.8.3)
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Expectations
3
3
  # @private
4
4
  module Version
5
- STRING = '3.8.3'
5
+ STRING = '3.8.4'
6
6
  end
7
7
  end
8
8
  end
@@ -14,17 +14,11 @@ module RSpec
14
14
  private
15
15
 
16
16
  def match(expected, actual)
17
- if actual_object_respond_to?(actual, :instance_of?)
18
- actual.instance_of?(expected)
19
- else
20
- raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
21
- "the actual object responds to #instance_of? method " \
22
- "but it does not respond to the method."
23
- end
24
- end
25
-
26
- def actual_object_respond_to?(actual, method)
27
- ::Kernel.instance_method(:respond_to?).bind(actual).call(method)
17
+ actual.instance_of?(expected)
18
+ rescue NoMethodError
19
+ raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
20
+ "the actual object responds to #instance_of? method " \
21
+ "but a `NoMethodError` was encountered instead."
28
22
  end
29
23
  end
30
24
  end
@@ -8,19 +8,11 @@ module RSpec
8
8
  private
9
9
 
10
10
  def match(expected, actual)
11
- if actual_object_respond_to?(actual, :kind_of?)
12
- actual.kind_of?(expected)
13
- elsif actual_object_respond_to?(actual, :is_a?)
14
- actual.is_a?(expected)
15
- else
16
- raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
17
- "the actual object responds to either #kind_of? or #is_a? methods "\
18
- "but it responds to neigher of two methods."
19
- end
20
- end
21
-
22
- def actual_object_respond_to?(actual, method)
23
- ::Kernel.instance_method(:respond_to?).bind(actual).call(method)
11
+ actual.kind_of?(expected)
12
+ rescue NoMethodError
13
+ raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
14
+ "the actual object responds to #kind_of? method " \
15
+ "but a `NoMethodError` was encountered instead."
24
16
  end
25
17
  end
26
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-expectations
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.3
4
+ version: 3.8.4
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: 2019-04-21 00:00:00.000000000 Z
48
+ date: 2019-06-10 00:00:00.000000000 Z
49
49
  dependencies:
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec-support
@@ -202,7 +202,7 @@ licenses:
202
202
  - MIT
203
203
  metadata:
204
204
  bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
205
- changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.8.3/Changelog.md
205
+ changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.8.4/Changelog.md
206
206
  documentation_uri: https://rspec.info/documentation/
207
207
  mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
208
208
  source_code_uri: https://github.com/rspec/rspec-expectations
@@ -225,5 +225,5 @@ requirements: []
225
225
  rubygems_version: 3.0.3
226
226
  signing_key:
227
227
  specification_version: 4
228
- summary: rspec-expectations-3.8.3
228
+ summary: rspec-expectations-3.8.4
229
229
  test_files: []
metadata.gz.sig CHANGED
Binary file