rspec-expectations 3.12.3 → 3.13.5
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 +189 -132
- data/README.md +10 -4
- data/lib/rspec/expectations/block_snippet_extractor.rb +2 -0
- data/lib/rspec/expectations/configuration.rb +28 -14
- data/lib/rspec/expectations/fail_with.rb +1 -1
- data/lib/rspec/expectations/failure_aggregator.rb +7 -0
- data/lib/rspec/expectations/handler.rb +4 -5
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/built_in/base_matcher.rb +45 -18
- data/lib/rspec/matchers/built_in/change.rb +2 -0
- data/lib/rspec/matchers/built_in/compound.rb +6 -3
- data/lib/rspec/matchers/built_in/contain_exactly.rb +2 -0
- data/lib/rspec/matchers/built_in/count_expectation.rb +2 -0
- data/lib/rspec/matchers/built_in/eq.rb +5 -1
- data/lib/rspec/matchers/built_in/eql.rb +5 -1
- data/lib/rspec/matchers/built_in/has.rb +29 -2
- data/lib/rspec/matchers/built_in/include.rb +5 -0
- data/lib/rspec/matchers/built_in/match.rb +14 -0
- data/lib/rspec/matchers/built_in/raise_error.rb +5 -1
- data/lib/rspec/matchers/built_in/satisfy.rb +2 -0
- data/lib/rspec/matchers/dsl.rb +6 -5
- data/lib/rspec/matchers/english_phrasing.rb +2 -0
- data/lib/rspec/matchers/matcher_delegator.rb +27 -1
- data/lib/rspec/matchers/{expecteds_for_multiple_diffs.rb → multi_matcher_diff.rb} +16 -16
- data/lib/rspec/matchers.rb +3 -1
- data.tar.gz.sig +0 -0
- metadata +28 -87
- metadata.gz.sig +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Matchers
|
3
3
|
# @api private
|
4
|
-
# Handles list of expected
|
5
|
-
# multiple diffs. Also can handle one
|
6
|
-
class
|
4
|
+
# Handles list of expected and actual value pairs when there is a need
|
5
|
+
# to render multiple diffs. Also can handle one pair.
|
6
|
+
class MultiMatcherDiff
|
7
7
|
# @private
|
8
8
|
# Default diff label when there is only one matcher in diff
|
9
9
|
# output
|
@@ -19,22 +19,23 @@ module RSpec
|
|
19
19
|
|
20
20
|
# @api private
|
21
21
|
# Wraps provided expected value in instance of
|
22
|
-
#
|
23
|
-
#
|
22
|
+
# MultiMatcherDiff. If provided value is already an
|
23
|
+
# MultiMatcherDiff then it just returns it.
|
24
24
|
# @param [Any] expected value to be wrapped
|
25
|
-
# @
|
26
|
-
|
25
|
+
# @param [Any] actual value
|
26
|
+
# @return [RSpec::Matchers::MultiMatcherDiff]
|
27
|
+
def self.from(expected, actual)
|
27
28
|
return expected if self === expected
|
28
|
-
new([[expected, DEFAULT_DIFF_LABEL]])
|
29
|
+
new([[expected, DEFAULT_DIFF_LABEL, actual]])
|
29
30
|
end
|
30
31
|
|
31
32
|
# @api private
|
32
33
|
# Wraps provided matcher list in instance of
|
33
|
-
#
|
34
|
+
# MultiMatcherDiff.
|
34
35
|
# @param [Array<Any>] matchers list of matchers to wrap
|
35
|
-
# @return [RSpec::Matchers::
|
36
|
+
# @return [RSpec::Matchers::MultiMatcherDiff]
|
36
37
|
def self.for_many_matchers(matchers)
|
37
|
-
new(matchers.map { |m| [m.expected, diff_label_for(m)] })
|
38
|
+
new(matchers.map { |m| [m.expected, diff_label_for(m), m.actual] })
|
38
39
|
end
|
39
40
|
|
40
41
|
# @api private
|
@@ -42,10 +43,9 @@ module RSpec
|
|
42
43
|
# factory and actual value if there are any
|
43
44
|
# @param [String] message original failure message
|
44
45
|
# @param [Proc] differ
|
45
|
-
# @param [Any] actual value
|
46
46
|
# @return [String]
|
47
|
-
def message_with_diff(message, differ
|
48
|
-
diff = diffs(differ
|
47
|
+
def message_with_diff(message, differ)
|
48
|
+
diff = diffs(differ)
|
49
49
|
message = "#{message}\n#{diff}" unless diff.empty?
|
50
50
|
message
|
51
51
|
end
|
@@ -65,8 +65,8 @@ module RSpec
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
def diffs(differ
|
69
|
-
@expected_list.map do |(expected, diff_label)|
|
68
|
+
def diffs(differ)
|
69
|
+
@expected_list.map do |(expected, diff_label, actual)|
|
70
70
|
diff = differ.diff(actual, expected)
|
71
71
|
next if diff.strip.empty?
|
72
72
|
if diff == "\e[0m\n\e[0m"
|
data/lib/rspec/matchers.rb
CHANGED
@@ -10,7 +10,7 @@ RSpec::Support.define_optimized_require_for_rspec(:matchers) { |f| require_relat
|
|
10
10
|
dsl
|
11
11
|
matcher_delegator
|
12
12
|
aliased_matcher
|
13
|
-
|
13
|
+
multi_matcher_diff
|
14
14
|
].each { |file| RSpec::Support.require_rspec_matchers(file) }
|
15
15
|
|
16
16
|
# RSpec's top level namespace. All of rspec-expectations is contained
|
@@ -1018,6 +1018,7 @@ module RSpec
|
|
1018
1018
|
# than _before_, like `append_features`. It's important we check this before
|
1019
1019
|
# in order to find the cases where it was already previously included.
|
1020
1020
|
# @api private
|
1021
|
+
# :nocov:
|
1021
1022
|
def append_features(mod)
|
1022
1023
|
return super if mod < self # `mod < self` indicates a re-inclusion.
|
1023
1024
|
|
@@ -1038,6 +1039,7 @@ module RSpec
|
|
1038
1039
|
|
1039
1040
|
super
|
1040
1041
|
end
|
1042
|
+
# :nocov:
|
1041
1043
|
end
|
1042
1044
|
end
|
1043
1045
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-expectations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.13.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
8
8
|
- David Chelimsky
|
9
9
|
- Myron Marston
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain:
|
13
12
|
- |
|
14
13
|
-----BEGIN CERTIFICATE-----
|
15
|
-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0OBBYEFPPvQ5XT0Nvuhi6k+hrWVv35J+TeMA0GCSqGSIb3DQEBCwUAA4IC
|
34
|
+
AQBGBr0ll2yLrkO6IeK5Q7qZFnANaUCKfi6Of9VztZJXgKAU5KAQxyOidGktoA5N
|
35
|
+
lp+bFKudRkW8jSehqoNaNBdSZ9Bc07EGMXIhUFJZF9rq7Z2SKPwUm6EaSsBK13QR
|
36
|
+
U4K6wuaw5ZJSFzklapoGOJRGnFlnNtlhNFY6+tTwCeblwZbcuYGyGY8+Rg7GbyVl
|
37
|
+
3Tr4Gi1aS/qG/MDXKdE8HWm39dmaAMdbw6dg1VBd0JrX2VqH7xvE1dM/D3OlKrNp
|
38
|
+
gNFRNJig3Y8qPjocZR0cGkhgZoC9wribWxHSNawZm4CoV3fja2HNx9QyM7BaB+as
|
39
|
+
yuqAiBbA7vBcyc8nKATip3mxbyXYXoDD7nmO8JCPP7O/WsgG+U/B2a0kPdvYFoxE
|
40
|
+
Q0Js3GtFCuMvL+0rifqdxBOLtu0Pw9q4RvToTJIl2IR6eTgCb82B1hw9qKf7PjuL
|
41
|
+
BoEsYjjDhGw6FZvcJG8O6uj7aB+z4aF21YR74UGL7sq/RIPNNez5JI95jTGfqCPy
|
42
|
+
6yo0w3zja3yg28QK3Fj+tbOHeSLv9SDQWi/1jiPprGzbxGvbVvjvX11YZc46vkmY
|
43
|
+
AwP+qZPPf97FXXZGEGIYhhHpnj+Ltx9nCetRPiZ4rvYBcXgCWVQSg6eiEofrMwn/
|
44
|
+
AKMCABhZ1Y2eATsfMgdkmIZk7JIPZiSi6eUxPiCMP9M/pw==
|
47
45
|
-----END CERTIFICATE-----
|
48
|
-
date:
|
46
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
49
47
|
dependencies:
|
50
48
|
- !ruby/object:Gem::Dependency
|
51
49
|
name: rspec-support
|
@@ -53,14 +51,14 @@ dependencies:
|
|
53
51
|
requirements:
|
54
52
|
- - "~>"
|
55
53
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.
|
54
|
+
version: 3.13.0
|
57
55
|
type: :runtime
|
58
56
|
prerelease: false
|
59
57
|
version_requirements: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
59
|
- - "~>"
|
62
60
|
- !ruby/object:Gem::Version
|
63
|
-
version: 3.
|
61
|
+
version: 3.13.0
|
64
62
|
- !ruby/object:Gem::Dependency
|
65
63
|
name: diff-lcs
|
66
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,62 +79,6 @@ dependencies:
|
|
81
79
|
- - "<"
|
82
80
|
- !ruby/object:Gem::Version
|
83
81
|
version: '2.0'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: aruba
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: 0.14.10
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 0.14.10
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: cucumber
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - ">="
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '1.3'
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '1.3'
|
112
|
-
- !ruby/object:Gem::Dependency
|
113
|
-
name: minitest
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - "~>"
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '5.2'
|
119
|
-
type: :development
|
120
|
-
prerelease: false
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - "~>"
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '5.2'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: rake
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">"
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: 10.0.0
|
133
|
-
type: :development
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - ">"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: 10.0.0
|
140
82
|
description: rspec-expectations provides a simple, readable API to express expected
|
141
83
|
outcomes of a code example.
|
142
84
|
email: rspec@googlegroups.com
|
@@ -193,21 +135,21 @@ files:
|
|
193
135
|
- lib/rspec/matchers/composable.rb
|
194
136
|
- lib/rspec/matchers/dsl.rb
|
195
137
|
- lib/rspec/matchers/english_phrasing.rb
|
196
|
-
- lib/rspec/matchers/expecteds_for_multiple_diffs.rb
|
197
138
|
- lib/rspec/matchers/fail_matchers.rb
|
198
139
|
- lib/rspec/matchers/generated_descriptions.rb
|
199
140
|
- lib/rspec/matchers/matcher_delegator.rb
|
200
141
|
- lib/rspec/matchers/matcher_protocol.rb
|
201
|
-
|
142
|
+
- lib/rspec/matchers/multi_matcher_diff.rb
|
143
|
+
homepage: https://rspec.info
|
202
144
|
licenses:
|
203
145
|
- MIT
|
204
146
|
metadata:
|
205
|
-
bug_tracker_uri: https://github.com/rspec/rspec
|
206
|
-
changelog_uri: https://github.com/rspec/rspec
|
147
|
+
bug_tracker_uri: https://github.com/rspec/rspec/issues
|
148
|
+
changelog_uri: https://github.com/rspec/rspec/blob/rspec-expectations-v3.13.5/rspec-expectations/Changelog.md
|
207
149
|
documentation_uri: https://rspec.info/documentation/
|
208
150
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
209
|
-
|
210
|
-
|
151
|
+
rubygems_mfa_required: 'true'
|
152
|
+
source_code_uri: https://github.com/rspec/rspec/blob/rspec-expectations-v3.13.5/rspec-expectations
|
211
153
|
rdoc_options:
|
212
154
|
- "--charset=UTF-8"
|
213
155
|
require_paths:
|
@@ -223,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
165
|
- !ruby/object:Gem::Version
|
224
166
|
version: '0'
|
225
167
|
requirements: []
|
226
|
-
rubygems_version: 3.
|
227
|
-
signing_key:
|
168
|
+
rubygems_version: 3.6.7
|
228
169
|
specification_version: 4
|
229
|
-
summary: rspec-expectations-3.
|
170
|
+
summary: rspec-expectations-3.13.5
|
230
171
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|