rspec-expectations 3.10.1 → 3.10.2

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: 487ee657765cb954821ff9cdff9298e5442431c611eb83f380afe9151e865a01
4
- data.tar.gz: 5c6a1b5e7c99e1f58029cef0f0dce644d83d64fe265155aadb3f247b0b3fbe32
3
+ metadata.gz: a1042199b6d7c762e4a79740c4996cfb198c2a5599091f9e80c4b934021dcfdd
4
+ data.tar.gz: 4aadaf8516b655b927d4daa574851e4d2113b7c0294b83f01a751b0ee785d11e
5
5
  SHA512:
6
- metadata.gz: a5f4383ba85185e8c59ccf2f1523835fb64e02e1828e37b2d5a93bd1be320c6152e0783b14fd524d753b8ef18d7dc7205fe25481a8adbadf2bf6b8c63acd3965
7
- data.tar.gz: 710360cfef64576512eab6a165cd6e54cde44648d20ff40598a047af2fbce20f88caf00bf695c74c53c78e404505a4bfa6f196f5481bc7a7a742c1898c98a398
6
+ metadata.gz: f78ad1ed8b49b3ad14c101221cfc8d380f01e31ea4c374b480ca1a514e26a3933bb05b1a1123e12cadaa5aff1d35b6e556703f0783f297dc0502e3ff2306404f
7
+ data.tar.gz: 8998ea12bd8f10ae89b18b2e138b338839202db95bb88328b16ce5435422c1cc1f2b6625f2a97aa653749ca33e93a288db7720526da954e01999214d99eb798d
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### Development
2
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.2...3-10-maintenance)
3
+
4
+ ### 3.10.2 / 2022-01-14
5
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.1...v3.10.2)
6
+
7
+ Bug Fixes:
8
+
9
+ * Fix support for dynamic matchers for expectation target checks (Phil Pirozhkov, #1294)
10
+ * Fix `expect(array).to include(hash).times`, previously this would fail due to
11
+ matching the entire array as a single hash, rather than a member of the hash.
12
+ (Slava Kardakov, #1322)
13
+ * Ensure `raise_error` matches works with the `error_highlight` option from Ruby 3.1.
14
+ (Peter Goldstein, #1339)
15
+
1
16
  ### 3.10.1 / 2020-12-27
2
17
  [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.0...v3.10.1)
3
18
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RSpec Expectations [![Build Status](https://secure.travis-ci.org/rspec/rspec-expectations.svg?branch=main)](http://travis-ci.org/rspec/rspec-expectations) [![Code Climate](https://codeclimate.com/github/rspec/rspec-expectations.svg)](https://codeclimate.com/github/rspec/rspec-expectations)
1
+ # RSpec Expectations [![Build Status](https://github.com/rspec/rspec-expectations/workflows/RSpec%20CI/badge.svg?branch=3-10-maintenance)](https://github.com/rspec/rspec-expectations/actions) [![Code Climate](https://codeclimate.com/github/rspec/rspec-expectations.svg)](https://codeclimate.com/github/rspec/rspec-expectations)
2
2
 
3
3
  RSpec::Expectations lets you express expected outcomes on an object in an
4
4
  example.
@@ -57,7 +57,7 @@ module RSpec
57
57
  # expect { perform }.to raise_error
58
58
  # @param [Matcher]
59
59
  # matcher
60
- # @param [String or Proc] message optional message to display when the expectation fails
60
+ # @param [String, Proc] message optional message to display when the expectation fails
61
61
  # @return [Boolean] true if the expectation succeeds (else raises)
62
62
  # @see RSpec::Matchers
63
63
  def to(matcher=nil, message=nil, &block)
@@ -70,7 +70,7 @@ module RSpec
70
70
  # expect(value).not_to eq(5)
71
71
  # @param [Matcher]
72
72
  # matcher
73
- # @param [String or Proc] message optional message to display when the expectation fails
73
+ # @param [String, Proc] message optional message to display when the expectation fails
74
74
  # @return [Boolean] false if the negative expectation succeeds (else raises)
75
75
  # @see RSpec::Matchers
76
76
  def not_to(matcher=nil, message=nil, &block)
@@ -118,9 +118,7 @@ module RSpec
118
118
  end
119
119
 
120
120
  def supports_block_expectations?(matcher)
121
- matcher.supports_block_expectations?
122
- rescue NoMethodError
123
- false
121
+ matcher.respond_to?(:supports_block_expectations?) && matcher.supports_block_expectations?
124
122
  end
125
123
  end
126
124
  end
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Expectations
3
3
  # @private
4
4
  module Version
5
- STRING = '3.10.1'
5
+ STRING = '3.10.2'
6
6
  end
7
7
  end
8
8
  end
@@ -182,7 +182,7 @@ module RSpec
182
182
  when String
183
183
  actual.scan(expected.first).length
184
184
  when Enumerable
185
- count_enumerable(expected.first)
185
+ count_enumerable(Hash === expected ? expected : expected.first)
186
186
  else
187
187
  raise NotImplementedError, 'Count constraints are implemented for Enumerable and String values only'
188
188
  end
@@ -59,7 +59,7 @@ module RSpec
59
59
  given_proc.call
60
60
  rescue Exception => @actual_error
61
61
  if values_match?(@expected_error, @actual_error) ||
62
- values_match?(@expected_error, @actual_error.message)
62
+ values_match?(@expected_error, actual_error_message)
63
63
  @raised_expected_error = true
64
64
  @with_expected_message = verify_message
65
65
  end
@@ -93,7 +93,7 @@ module RSpec
93
93
  # @api private
94
94
  # @return [String]
95
95
  def failure_message
96
- @eval_block ? @actual_error.message : "expected #{expected_error}#{given_error}"
96
+ @eval_block ? actual_error_message : "expected #{expected_error}#{given_error}"
97
97
  end
98
98
 
99
99
  # @api private
@@ -110,6 +110,12 @@ module RSpec
110
110
 
111
111
  private
112
112
 
113
+ def actual_error_message
114
+ return nil unless @actual_error
115
+
116
+ @actual_error.respond_to?(:original_message) ? @actual_error.original_message : @actual_error.message
117
+ end
118
+
113
119
  def expectation_matched?
114
120
  error_and_message_match? && block_matches?
115
121
  end
@@ -138,7 +144,7 @@ module RSpec
138
144
 
139
145
  def verify_message
140
146
  return true if @expected_message.nil?
141
- values_match?(@expected_message, @actual_error.message.to_s)
147
+ values_match?(@expected_message, actual_error_message.to_s)
142
148
  end
143
149
 
144
150
  def warn_for_negative_false_positives!
data.tar.gz.sig CHANGED
Binary file
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.10.1
4
+ version: 3.10.2
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-12-27 00:00:00.000000000 Z
48
+ date: 2022-01-14 00:00:00.000000000 Z
49
49
  dependencies:
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec-support
@@ -99,14 +99,14 @@ dependencies:
99
99
  name: cucumber
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - "~>"
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '1.3'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - "~>"
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '1.3'
112
112
  - !ruby/object:Gem::Dependency
@@ -203,7 +203,7 @@ licenses:
203
203
  - MIT
204
204
  metadata:
205
205
  bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
206
- changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.10.1/Changelog.md
206
+ changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.10.2/Changelog.md
207
207
  documentation_uri: https://rspec.info/documentation/
208
208
  mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
209
209
  source_code_uri: https://github.com/rspec/rspec-expectations
@@ -223,8 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
- rubygems_version: 3.2.3
226
+ rubygems_version: 3.3.3
227
227
  signing_key:
228
228
  specification_version: 4
229
- summary: rspec-expectations-3.10.1
229
+ summary: rspec-expectations-3.10.2
230
230
  test_files: []
metadata.gz.sig CHANGED
Binary file