rspec-expectations 3.12.1 → 3.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +20 -5
- data/lib/rspec/expectations/failure_aggregator.rb +1 -1
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/aliased_matcher.rb +3 -3
- data/lib/rspec/matchers/built_in/compound.rb +1 -1
- data/lib/rspec/matchers/built_in/exist.rb +1 -1
- data/lib/rspec/matchers/built_in/include.rb +9 -2
- data/lib/rspec/matchers/composable.rb +1 -1
- data/lib/rspec/matchers/dsl.rb +7 -7
- data/lib/rspec/matchers.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: d167a03fcf6e4519b628fefcf03b644e6436e1f6769058d84431fab3181e5119
|
4
|
+
data.tar.gz: dccb3d8b5ed822e523989e59e897085584173d65a503be30166b9d14bba675ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc027c3d982da4f60e13924ef494fe4df964ee64ccd405eaf69a522494e23d394d0560dfa32c2007a8f43831118ad20df6480ed5692dbe70b389dfcc724e7266
|
7
|
+
data.tar.gz: 61e1c4f7ce7514869e63d24e7eb3270861ea4ad6343c34127b04f757bd80009dd599ae94be25c925b1de265fb4dc5a68f9619b9e3293de46b4aabd0cd1595dae
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
### Development
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.3...3-12-maintenance)
|
3
|
+
|
4
|
+
### 3.12.3 / 2023-04-20
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.2...v3.12.3)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Fix `include` matcher when fuzzy matching on keys with a hash-like actual which
|
10
|
+
has a non standard `key?` method which may raise.
|
11
|
+
(Jon Rowe, #1416)
|
12
|
+
|
13
|
+
### 3.12.2 / 2023-01-07
|
14
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.1...v3.12.2)
|
15
|
+
|
16
|
+
Bug Fixes:
|
17
|
+
|
18
|
+
* Prevent deprecation warning when using the `exist` matcher with `Dir`.
|
19
|
+
(Steve Dierker, #1398)
|
3
20
|
|
4
21
|
### 3.12.1 / 2022-12-16
|
5
22
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.0...v3.12.1)
|
@@ -323,10 +340,8 @@ Enhancements:
|
|
323
340
|
can cause uses of `super` to trigger infinite recursion. (Myron Marston, #816)
|
324
341
|
* Stop rescuing `NoMemoryError`, `SignalExcepetion`, `Interrupt` and
|
325
342
|
`SystemExit`. It is dangerous to interfere with these. (Myron Marston, #845)
|
326
|
-
* Add `#with_captures` to the
|
327
|
-
|
328
|
-
which allows a user to specify expected captures when matching a regex
|
329
|
-
against a string. (Sam Phippen, #848)
|
343
|
+
* Add `#with_captures` to the match matcher which allows a user to specify expected
|
344
|
+
captures when matching a regex against a string. (Sam Phippen, #848)
|
330
345
|
* Always print compound failure messages in the multi-line form. Trying
|
331
346
|
to print it all on a single line didn't read very well. (Myron Marston, #859)
|
332
347
|
|
@@ -9,7 +9,7 @@ module RSpec
|
|
9
9
|
# @private
|
10
10
|
MESSAGE =
|
11
11
|
'AggregatedFailure: This method caused a failure which has been ' \
|
12
|
-
'
|
12
|
+
'suppressed to be aggregated into our failure report by returning ' \
|
13
13
|
'this value, further errors can be ignored.'
|
14
14
|
|
15
15
|
def inspect
|
@@ -99,14 +99,14 @@ module RSpec
|
|
99
99
|
# by going through the effort of defining a negated matcher.
|
100
100
|
#
|
101
101
|
# However, if the override didn't actually change anything, then we
|
102
|
-
# should return the opposite failure message instead -- the
|
102
|
+
# should return the opposite failure message instead -- the overridden
|
103
103
|
# message is going to be confusing if we return it as-is, as it represents
|
104
104
|
# the non-negated failure message for a negated match (or vice versa).
|
105
105
|
def optimal_failure_message(same, inverted)
|
106
106
|
if DefaultFailureMessages.has_default_failure_messages?(@base_matcher)
|
107
107
|
base_message = @base_matcher.__send__(same)
|
108
|
-
|
109
|
-
return
|
108
|
+
overridden = @description_block.call(base_message)
|
109
|
+
return overridden if overridden != base_message
|
110
110
|
end
|
111
111
|
|
112
112
|
@base_matcher.__send__(inverted)
|
@@ -171,7 +171,7 @@ module RSpec
|
|
171
171
|
@match_results.fetch(matcher) do
|
172
172
|
raise ArgumentError, "Your #{matcher.description} has no match " \
|
173
173
|
"results, this can occur when an unexpected call stack or " \
|
174
|
-
"local jump occurs.
|
174
|
+
"local jump occurs. Perhaps one of your matchers needs to " \
|
175
175
|
"declare `expects_call_stack_jump?` as `true`?"
|
176
176
|
end
|
177
177
|
end
|
@@ -153,8 +153,15 @@ module RSpec
|
|
153
153
|
def actual_hash_has_key?(expected_key)
|
154
154
|
# We check `key?` first for perf:
|
155
155
|
# `key?` is O(1), but `any?` is O(N).
|
156
|
-
|
157
|
-
|
156
|
+
|
157
|
+
has_exact_key =
|
158
|
+
begin
|
159
|
+
actual.key?(expected_key)
|
160
|
+
rescue
|
161
|
+
false
|
162
|
+
end
|
163
|
+
|
164
|
+
has_exact_key || actual.keys.any? { |key| values_match?(expected_key, key) }
|
158
165
|
end
|
159
166
|
|
160
167
|
def actual_collection_includes?(expected_item)
|
@@ -83,7 +83,7 @@ module RSpec
|
|
83
83
|
RSpec::Support::ObjectFormatter.format(object)
|
84
84
|
end
|
85
85
|
|
86
|
-
# Transforms the given data
|
86
|
+
# Transforms the given data structure (typically a hash or array)
|
87
87
|
# into a new data structure that, when `#inspect` is called on it,
|
88
88
|
# will provide descriptions of any contained matchers rather than
|
89
89
|
# the normal `#inspect` output.
|
data/lib/rspec/matchers/dsl.rb
CHANGED
@@ -4,7 +4,7 @@ module RSpec
|
|
4
4
|
module Matchers
|
5
5
|
# Defines the custom matcher DSL.
|
6
6
|
module DSL
|
7
|
-
# Defines a matcher alias. The returned matcher's `description` will be
|
7
|
+
# Defines a matcher alias. The returned matcher's `description` will be overridden
|
8
8
|
# to reflect the phrasing of the new name, which will be used in failure messages
|
9
9
|
# when passed as an argument to another matcher in a composed matcher expression.
|
10
10
|
#
|
@@ -25,7 +25,7 @@ module RSpec
|
|
25
25
|
# @param old_name [Symbol] the original name for the matcher
|
26
26
|
# @param options [Hash] options for the aliased matcher
|
27
27
|
# @option options [Class] :klass the ruby class to use as the decorator. (Not normally used).
|
28
|
-
# @yield [String] optional block that, when given, is used to define the
|
28
|
+
# @yield [String] optional block that, when given, is used to define the overridden
|
29
29
|
# logic. The yielded arg is the original description or failure message. If no
|
30
30
|
# block is provided, a default override is used based on the old and new names.
|
31
31
|
# @see RSpec::Matchers
|
@@ -44,7 +44,7 @@ module RSpec
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# Defines a negated matcher. The returned matcher's `description` and `failure_message`
|
47
|
-
# will be
|
47
|
+
# will be overridden to reflect the phrasing of the new name, and the match logic will
|
48
48
|
# be based on the original matcher but negated.
|
49
49
|
#
|
50
50
|
# @example
|
@@ -54,7 +54,7 @@ module RSpec
|
|
54
54
|
#
|
55
55
|
# @param negated_name [Symbol] the name for the negated matcher
|
56
56
|
# @param base_name [Symbol] the name of the original matcher that will be negated
|
57
|
-
# @yield [String] optional block that, when given, is used to define the
|
57
|
+
# @yield [String] optional block that, when given, is used to define the overridden
|
58
58
|
# logic. The yielded arg is the original description or failure message. If no
|
59
59
|
# block is provided, a default override is used based on the old and new names.
|
60
60
|
# @see RSpec::Matchers
|
@@ -198,7 +198,7 @@ module RSpec
|
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
201
|
-
# Customizes the failure
|
201
|
+
# Customizes the failure message to use when this matcher is
|
202
202
|
# asked to positively match. Only use this when the message
|
203
203
|
# generated by default doesn't suit your needs.
|
204
204
|
#
|
@@ -217,7 +217,7 @@ module RSpec
|
|
217
217
|
define_user_override(__method__, definition)
|
218
218
|
end
|
219
219
|
|
220
|
-
# Customize the failure
|
220
|
+
# Customize the failure message to use when this matcher is asked
|
221
221
|
# to negatively match. Only use this when the message generated by
|
222
222
|
# default doesn't suit your needs.
|
223
223
|
#
|
@@ -331,7 +331,7 @@ module RSpec
|
|
331
331
|
# - Defines the named method using a user-provided block
|
332
332
|
# in @user_method_defs, which is included as an ancestor
|
333
333
|
# in the singleton class in which we eval the `define` block.
|
334
|
-
# - Defines an
|
334
|
+
# - Defines an overridden definition for the same method
|
335
335
|
# usign the provided `our_def` block.
|
336
336
|
# - Provides a default `our_def` block for the common case
|
337
337
|
# of needing to call the user's definition with `@actual`
|
data/lib/rspec/matchers.rb
CHANGED
@@ -704,7 +704,7 @@ module RSpec
|
|
704
704
|
|
705
705
|
# An alternate form of `contain_exactly` that accepts
|
706
706
|
# the expected contents as a single array arg rather
|
707
|
-
#
|
707
|
+
# than splatted out as individual items.
|
708
708
|
#
|
709
709
|
# @example
|
710
710
|
# expect(results).to contain_exactly(1, 2)
|
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.12.
|
4
|
+
version: 3.12.3
|
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:
|
48
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -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.12.
|
206
|
+
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.12.3/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
|
@@ -226,5 +226,5 @@ requirements: []
|
|
226
226
|
rubygems_version: 3.3.26
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
|
-
summary: rspec-expectations-3.12.
|
229
|
+
summary: rspec-expectations-3.12.3
|
230
230
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|