rspec-expectations 3.12.0 → 3.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +18 -1
- data/lib/rspec/expectations/failure_aggregator.rb +17 -0
- 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/composable.rb +1 -1
- data/lib/rspec/matchers/dsl.rb +8 -7
- data/lib/rspec/matchers.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- 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: f0b59eb5a0bf0dcaf99ae45b411fa1d8e73a3cf5b0694f06170205ff36b22bc1
|
4
|
+
data.tar.gz: 91f0f17601c3853d8e10219dfb2c41a53fba78b4d3c546870ebe1fac9de70a6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99e2aff242508b307566d95120c66e507cde5da5e6aec973365b747e1b16fde3ab34445ce2cfddf153baeac2c3f75c05b1e0f105465118544aad8fb9dafbe37e
|
7
|
+
data.tar.gz: c69b2d96fc2c3abec310e9e36b346cc3a1017a160906c795b1218b1e1a2dbea10055a80fc89da6510c89eb9cc7ef82e7f24c63ff2893f3c692a008de0ec838f1
|
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.1...3-12-maintenance)
|
3
|
+
|
4
|
+
### 3.12.2 / 2023-01-07
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.1...v3.12.2)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Prevent deprecation warning when using the `exist` matcher with `Dir`.
|
10
|
+
(Steve Dierker, #1398)
|
11
|
+
|
12
|
+
### 3.12.1 / 2022-12-16
|
13
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.12.0...v3.12.1)
|
14
|
+
|
15
|
+
Bug Fixes:
|
16
|
+
|
17
|
+
* Pass keyword arguments through to aliased (and thus negated) matchers. (Jon Rowe, #1394)
|
18
|
+
* When handling failures in an aggregated_failures block (or example) prevent
|
19
|
+
the failure list leaking out. (Maciek Rząsa, #1392)
|
3
20
|
|
4
21
|
### 3.12.0 / 2022-10-26
|
5
22
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.11.1...v3.12.0)
|
@@ -4,6 +4,21 @@ module RSpec
|
|
4
4
|
class FailureAggregator
|
5
5
|
attr_reader :block_label, :metadata
|
6
6
|
|
7
|
+
# @private
|
8
|
+
class AggregatedFailure
|
9
|
+
# @private
|
10
|
+
MESSAGE =
|
11
|
+
'AggregatedFailure: This method caused a failure which has been ' \
|
12
|
+
'suppressed to be aggregated into our failure report by returning ' \
|
13
|
+
'this value, further errors can be ignored.'
|
14
|
+
|
15
|
+
def inspect
|
16
|
+
MESSAGE
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
AGGREGATED_FAILURE = AggregatedFailure.new
|
21
|
+
|
7
22
|
def aggregate
|
8
23
|
RSpec::Support.with_failure_notifier(self) do
|
9
24
|
begin
|
@@ -48,6 +63,8 @@ module RSpec
|
|
48
63
|
@seen_source_ids[source_id] = true
|
49
64
|
assign_backtrace(failure) unless failure.backtrace
|
50
65
|
failures << failure
|
66
|
+
|
67
|
+
AGGREGATED_FAILURE
|
51
68
|
end
|
52
69
|
|
53
70
|
private
|
@@ -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
|
@@ -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
|
@@ -40,10 +40,11 @@ module RSpec
|
|
40
40
|
matcher.matcher_name = new_name if matcher.respond_to?(:matcher_name=)
|
41
41
|
klass.new(matcher, description_override)
|
42
42
|
end
|
43
|
+
ruby2_keywords new_name if respond_to?(:ruby2_keywords, true)
|
43
44
|
end
|
44
45
|
|
45
46
|
# Defines a negated matcher. The returned matcher's `description` and `failure_message`
|
46
|
-
# will be
|
47
|
+
# will be overridden to reflect the phrasing of the new name, and the match logic will
|
47
48
|
# be based on the original matcher but negated.
|
48
49
|
#
|
49
50
|
# @example
|
@@ -53,7 +54,7 @@ module RSpec
|
|
53
54
|
#
|
54
55
|
# @param negated_name [Symbol] the name for the negated matcher
|
55
56
|
# @param base_name [Symbol] the name of the original matcher that will be negated
|
56
|
-
# @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
|
57
58
|
# logic. The yielded arg is the original description or failure message. If no
|
58
59
|
# block is provided, a default override is used based on the old and new names.
|
59
60
|
# @see RSpec::Matchers
|
@@ -197,7 +198,7 @@ module RSpec
|
|
197
198
|
end
|
198
199
|
end
|
199
200
|
|
200
|
-
# Customizes the failure
|
201
|
+
# Customizes the failure message to use when this matcher is
|
201
202
|
# asked to positively match. Only use this when the message
|
202
203
|
# generated by default doesn't suit your needs.
|
203
204
|
#
|
@@ -216,7 +217,7 @@ module RSpec
|
|
216
217
|
define_user_override(__method__, definition)
|
217
218
|
end
|
218
219
|
|
219
|
-
# Customize the failure
|
220
|
+
# Customize the failure message to use when this matcher is asked
|
220
221
|
# to negatively match. Only use this when the message generated by
|
221
222
|
# default doesn't suit your needs.
|
222
223
|
#
|
@@ -330,7 +331,7 @@ module RSpec
|
|
330
331
|
# - Defines the named method using a user-provided block
|
331
332
|
# in @user_method_defs, which is included as an ancestor
|
332
333
|
# in the singleton class in which we eval the `define` block.
|
333
|
-
# - Defines an
|
334
|
+
# - Defines an overridden definition for the same method
|
334
335
|
# usign the provided `our_def` block.
|
335
336
|
# - Provides a default `our_def` block for the common case
|
336
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.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:
|
48
|
+
date: 2023-01-07 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.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.3.
|
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.2
|
230
230
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|