rspec-expectations 3.0.4 → 3.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/.document +1 -1
- data/.yardopts +1 -1
- data/Changelog.md +530 -5
- data/{License.txt → LICENSE.md} +5 -4
- data/README.md +73 -31
- data/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
- data/lib/rspec/expectations/configuration.rb +96 -1
- data/lib/rspec/expectations/expectation_target.rb +82 -38
- data/lib/rspec/expectations/fail_with.rb +11 -6
- data/lib/rspec/expectations/failure_aggregator.rb +229 -0
- data/lib/rspec/expectations/handler.rb +36 -15
- data/lib/rspec/expectations/minitest_integration.rb +43 -2
- data/lib/rspec/expectations/syntax.rb +5 -5
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/expectations.rb +15 -1
- data/lib/rspec/matchers/aliased_matcher.rb +79 -4
- data/lib/rspec/matchers/built_in/all.rb +11 -0
- data/lib/rspec/matchers/built_in/base_matcher.rb +111 -28
- data/lib/rspec/matchers/built_in/be.rb +28 -114
- data/lib/rspec/matchers/built_in/be_between.rb +1 -1
- data/lib/rspec/matchers/built_in/be_instance_of.rb +5 -1
- data/lib/rspec/matchers/built_in/be_kind_of.rb +5 -1
- data/lib/rspec/matchers/built_in/be_within.rb +5 -12
- data/lib/rspec/matchers/built_in/change.rb +171 -63
- data/lib/rspec/matchers/built_in/compound.rb +201 -30
- data/lib/rspec/matchers/built_in/contain_exactly.rb +73 -12
- data/lib/rspec/matchers/built_in/count_expectation.rb +169 -0
- data/lib/rspec/matchers/built_in/eq.rb +3 -38
- data/lib/rspec/matchers/built_in/eql.rb +2 -2
- data/lib/rspec/matchers/built_in/equal.rb +3 -3
- data/lib/rspec/matchers/built_in/exist.rb +7 -3
- data/lib/rspec/matchers/built_in/has.rb +93 -30
- data/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
- data/lib/rspec/matchers/built_in/include.rb +133 -25
- data/lib/rspec/matchers/built_in/match.rb +79 -2
- data/lib/rspec/matchers/built_in/operators.rb +14 -5
- data/lib/rspec/matchers/built_in/output.rb +59 -2
- data/lib/rspec/matchers/built_in/raise_error.rb +130 -27
- data/lib/rspec/matchers/built_in/respond_to.rb +117 -15
- data/lib/rspec/matchers/built_in/satisfy.rb +28 -14
- data/lib/rspec/matchers/built_in/{start_and_end_with.rb → start_or_end_with.rb} +20 -8
- data/lib/rspec/matchers/built_in/throw_symbol.rb +15 -5
- data/lib/rspec/matchers/built_in/yield.rb +129 -156
- data/lib/rspec/matchers/built_in.rb +5 -3
- data/lib/rspec/matchers/composable.rb +24 -36
- data/lib/rspec/matchers/dsl.rb +203 -37
- data/lib/rspec/matchers/english_phrasing.rb +58 -0
- data/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +82 -0
- data/lib/rspec/matchers/fail_matchers.rb +42 -0
- data/lib/rspec/matchers/generated_descriptions.rb +1 -2
- data/lib/rspec/matchers/matcher_delegator.rb +3 -4
- data/lib/rspec/matchers/matcher_protocol.rb +105 -0
- data/lib/rspec/matchers.rb +267 -144
- data.tar.gz.sig +0 -0
- metadata +71 -49
- metadata.gz.sig +0 -0
- data/lib/rspec/matchers/pretty.rb +0 -77
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,39 +1,51 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-expectations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
8
8
|
- David Chelimsky
|
9
9
|
- Myron Marston
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain:
|
13
13
|
- |
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
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lNSplL6DenIAKSh5kF7s0tRD0tC3bNkZmNjNGkdoGEcUODEpTB3RHKKiu
|
44
|
+
e6k2Jg6m00z5vGFQhOnROG/QaUzMA3A3mFBe1RHFo07xd0pFeoeWL3vF69Gx9Jwp
|
45
|
+
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
46
|
+
F3MdtaDehhjC
|
35
47
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
48
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
37
49
|
dependencies:
|
38
50
|
- !ruby/object:Gem::Dependency
|
39
51
|
name: rspec-support
|
@@ -41,14 +53,14 @@ dependencies:
|
|
41
53
|
requirements:
|
42
54
|
- - "~>"
|
43
55
|
- !ruby/object:Gem::Version
|
44
|
-
version: 3.
|
56
|
+
version: 3.12.0
|
45
57
|
type: :runtime
|
46
58
|
prerelease: false
|
47
59
|
version_requirements: !ruby/object:Gem::Requirement
|
48
60
|
requirements:
|
49
61
|
- - "~>"
|
50
62
|
- !ruby/object:Gem::Version
|
51
|
-
version: 3.
|
63
|
+
version: 3.12.0
|
52
64
|
- !ruby/object:Gem::Dependency
|
53
65
|
name: diff-lcs
|
54
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,61 +82,61 @@ dependencies:
|
|
70
82
|
- !ruby/object:Gem::Version
|
71
83
|
version: '2.0'
|
72
84
|
- !ruby/object:Gem::Dependency
|
73
|
-
name:
|
85
|
+
name: aruba
|
74
86
|
requirement: !ruby/object:Gem::Requirement
|
75
87
|
requirements:
|
76
88
|
- - "~>"
|
77
89
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
90
|
+
version: 0.14.10
|
79
91
|
type: :development
|
80
92
|
prerelease: false
|
81
93
|
version_requirements: !ruby/object:Gem::Requirement
|
82
94
|
requirements:
|
83
95
|
- - "~>"
|
84
96
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
97
|
+
version: 0.14.10
|
86
98
|
- !ruby/object:Gem::Dependency
|
87
99
|
name: cucumber
|
88
100
|
requirement: !ruby/object:Gem::Requirement
|
89
101
|
requirements:
|
90
|
-
- - "
|
102
|
+
- - ">="
|
91
103
|
- !ruby/object:Gem::Version
|
92
104
|
version: '1.3'
|
93
105
|
type: :development
|
94
106
|
prerelease: false
|
95
107
|
version_requirements: !ruby/object:Gem::Requirement
|
96
108
|
requirements:
|
97
|
-
- - "
|
109
|
+
- - ">="
|
98
110
|
- !ruby/object:Gem::Version
|
99
111
|
version: '1.3'
|
100
112
|
- !ruby/object:Gem::Dependency
|
101
|
-
name:
|
113
|
+
name: minitest
|
102
114
|
requirement: !ruby/object:Gem::Requirement
|
103
115
|
requirements:
|
104
116
|
- - "~>"
|
105
117
|
- !ruby/object:Gem::Version
|
106
|
-
version: '
|
118
|
+
version: '5.2'
|
107
119
|
type: :development
|
108
120
|
prerelease: false
|
109
121
|
version_requirements: !ruby/object:Gem::Requirement
|
110
122
|
requirements:
|
111
123
|
- - "~>"
|
112
124
|
- !ruby/object:Gem::Version
|
113
|
-
version: '
|
125
|
+
version: '5.2'
|
114
126
|
- !ruby/object:Gem::Dependency
|
115
|
-
name:
|
127
|
+
name: rake
|
116
128
|
requirement: !ruby/object:Gem::Requirement
|
117
129
|
requirements:
|
118
|
-
- - "
|
130
|
+
- - ">"
|
119
131
|
- !ruby/object:Gem::Version
|
120
|
-
version:
|
132
|
+
version: 10.0.0
|
121
133
|
type: :development
|
122
134
|
prerelease: false
|
123
135
|
version_requirements: !ruby/object:Gem::Requirement
|
124
136
|
requirements:
|
125
|
-
- - "
|
137
|
+
- - ">"
|
126
138
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
139
|
+
version: 10.0.0
|
128
140
|
description: rspec-expectations provides a simple, readable API to express expected
|
129
141
|
outcomes of a code example.
|
130
142
|
email: rspec@googlegroups.com
|
@@ -135,12 +147,14 @@ files:
|
|
135
147
|
- ".document"
|
136
148
|
- ".yardopts"
|
137
149
|
- Changelog.md
|
138
|
-
-
|
150
|
+
- LICENSE.md
|
139
151
|
- README.md
|
140
152
|
- lib/rspec/expectations.rb
|
153
|
+
- lib/rspec/expectations/block_snippet_extractor.rb
|
141
154
|
- lib/rspec/expectations/configuration.rb
|
142
155
|
- lib/rspec/expectations/expectation_target.rb
|
143
156
|
- lib/rspec/expectations/fail_with.rb
|
157
|
+
- lib/rspec/expectations/failure_aggregator.rb
|
144
158
|
- lib/rspec/expectations/handler.rb
|
145
159
|
- lib/rspec/expectations/minitest_integration.rb
|
146
160
|
- lib/rspec/expectations/syntax.rb
|
@@ -158,12 +172,14 @@ files:
|
|
158
172
|
- lib/rspec/matchers/built_in/change.rb
|
159
173
|
- lib/rspec/matchers/built_in/compound.rb
|
160
174
|
- lib/rspec/matchers/built_in/contain_exactly.rb
|
175
|
+
- lib/rspec/matchers/built_in/count_expectation.rb
|
161
176
|
- lib/rspec/matchers/built_in/cover.rb
|
162
177
|
- lib/rspec/matchers/built_in/eq.rb
|
163
178
|
- lib/rspec/matchers/built_in/eql.rb
|
164
179
|
- lib/rspec/matchers/built_in/equal.rb
|
165
180
|
- lib/rspec/matchers/built_in/exist.rb
|
166
181
|
- lib/rspec/matchers/built_in/has.rb
|
182
|
+
- lib/rspec/matchers/built_in/have_attributes.rb
|
167
183
|
- lib/rspec/matchers/built_in/include.rb
|
168
184
|
- lib/rspec/matchers/built_in/match.rb
|
169
185
|
- lib/rspec/matchers/built_in/operators.rb
|
@@ -171,19 +187,27 @@ files:
|
|
171
187
|
- lib/rspec/matchers/built_in/raise_error.rb
|
172
188
|
- lib/rspec/matchers/built_in/respond_to.rb
|
173
189
|
- lib/rspec/matchers/built_in/satisfy.rb
|
174
|
-
- lib/rspec/matchers/built_in/
|
190
|
+
- lib/rspec/matchers/built_in/start_or_end_with.rb
|
175
191
|
- lib/rspec/matchers/built_in/throw_symbol.rb
|
176
192
|
- lib/rspec/matchers/built_in/yield.rb
|
177
193
|
- lib/rspec/matchers/composable.rb
|
178
194
|
- lib/rspec/matchers/dsl.rb
|
195
|
+
- lib/rspec/matchers/english_phrasing.rb
|
196
|
+
- lib/rspec/matchers/expecteds_for_multiple_diffs.rb
|
197
|
+
- lib/rspec/matchers/fail_matchers.rb
|
179
198
|
- lib/rspec/matchers/generated_descriptions.rb
|
180
199
|
- lib/rspec/matchers/matcher_delegator.rb
|
181
|
-
- lib/rspec/matchers/
|
182
|
-
homepage:
|
200
|
+
- lib/rspec/matchers/matcher_protocol.rb
|
201
|
+
homepage: https://github.com/rspec/rspec-expectations
|
183
202
|
licenses:
|
184
203
|
- MIT
|
185
|
-
metadata:
|
186
|
-
|
204
|
+
metadata:
|
205
|
+
bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
|
206
|
+
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.12.3/Changelog.md
|
207
|
+
documentation_uri: https://rspec.info/documentation/
|
208
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
209
|
+
source_code_uri: https://github.com/rspec/rspec-expectations
|
210
|
+
post_install_message:
|
187
211
|
rdoc_options:
|
188
212
|
- "--charset=UTF-8"
|
189
213
|
require_paths:
|
@@ -199,10 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
223
|
- !ruby/object:Gem::Version
|
200
224
|
version: '0'
|
201
225
|
requirements: []
|
202
|
-
|
203
|
-
|
204
|
-
signing_key:
|
226
|
+
rubygems_version: 3.3.26
|
227
|
+
signing_key:
|
205
228
|
specification_version: 4
|
206
|
-
summary: rspec-expectations-3.
|
229
|
+
summary: rspec-expectations-3.12.3
|
207
230
|
test_files: []
|
208
|
-
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,77 +0,0 @@
|
|
1
|
-
module RSpec
|
2
|
-
module Matchers
|
3
|
-
# @api private
|
4
|
-
# Contains logic to facilitate converting ruby symbols and
|
5
|
-
# objects to english phrases.
|
6
|
-
module Pretty
|
7
|
-
# @api private
|
8
|
-
# Converts a symbol into an english expression.
|
9
|
-
def split_words(sym)
|
10
|
-
sym.to_s.gsub(/_/, ' ')
|
11
|
-
end
|
12
|
-
module_function :split_words
|
13
|
-
|
14
|
-
# @api private
|
15
|
-
# Converts a collection of objects into an english expression.
|
16
|
-
def to_sentence(words)
|
17
|
-
return " #{words.inspect}" if !words || Struct === words
|
18
|
-
words = Array(words).map { |w| to_word(w) }
|
19
|
-
case words.length
|
20
|
-
when 0
|
21
|
-
""
|
22
|
-
when 1
|
23
|
-
" #{words[0]}"
|
24
|
-
when 2
|
25
|
-
" #{words[0]} and #{words[1]}"
|
26
|
-
else
|
27
|
-
" #{words[0...-1].join(', ')}, and #{words[-1]}"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# @api private
|
32
|
-
# Converts the given item to string suitable for use in a list expression.
|
33
|
-
def to_word(item)
|
34
|
-
is_matcher_with_description?(item) ? item.description : item.inspect
|
35
|
-
end
|
36
|
-
|
37
|
-
# @private
|
38
|
-
# Provides an English expression for the matcher name.
|
39
|
-
def name_to_sentence
|
40
|
-
split_words(name)
|
41
|
-
end
|
42
|
-
|
43
|
-
# @api private
|
44
|
-
# Provides a name for the matcher.
|
45
|
-
def name
|
46
|
-
defined?(@name) ? @name : underscore(self.class.name.split("::").last)
|
47
|
-
end
|
48
|
-
|
49
|
-
# @private
|
50
|
-
# Borrowed from ActiveSupport
|
51
|
-
def underscore(camel_cased_word)
|
52
|
-
word = camel_cased_word.to_s.dup
|
53
|
-
word.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
54
|
-
word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
|
55
|
-
word.tr!("-", "_")
|
56
|
-
word.downcase!
|
57
|
-
word
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def is_matcher_with_description?(object)
|
63
|
-
RSpec::Matchers.is_a_matcher?(object) && object.respond_to?(:description)
|
64
|
-
end
|
65
|
-
|
66
|
-
# `{ :a => 5, :b => 2 }.inspect` produces:
|
67
|
-
# {:a=>5, :b=>2}
|
68
|
-
# ...but it looks much better as:
|
69
|
-
# {:a => 5, :b => 2}
|
70
|
-
#
|
71
|
-
# This is idempotent and safe to run on a string multiple times.
|
72
|
-
def improve_hash_formatting(inspect_string)
|
73
|
-
inspect_string.gsub(/(\S)=>(\S)/, '\1 => \2')
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|