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.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data/.document +1 -1
  4. data/.yardopts +1 -1
  5. data/Changelog.md +530 -5
  6. data/{License.txt → LICENSE.md} +5 -4
  7. data/README.md +73 -31
  8. data/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
  9. data/lib/rspec/expectations/configuration.rb +96 -1
  10. data/lib/rspec/expectations/expectation_target.rb +82 -38
  11. data/lib/rspec/expectations/fail_with.rb +11 -6
  12. data/lib/rspec/expectations/failure_aggregator.rb +229 -0
  13. data/lib/rspec/expectations/handler.rb +36 -15
  14. data/lib/rspec/expectations/minitest_integration.rb +43 -2
  15. data/lib/rspec/expectations/syntax.rb +5 -5
  16. data/lib/rspec/expectations/version.rb +1 -1
  17. data/lib/rspec/expectations.rb +15 -1
  18. data/lib/rspec/matchers/aliased_matcher.rb +79 -4
  19. data/lib/rspec/matchers/built_in/all.rb +11 -0
  20. data/lib/rspec/matchers/built_in/base_matcher.rb +111 -28
  21. data/lib/rspec/matchers/built_in/be.rb +28 -114
  22. data/lib/rspec/matchers/built_in/be_between.rb +1 -1
  23. data/lib/rspec/matchers/built_in/be_instance_of.rb +5 -1
  24. data/lib/rspec/matchers/built_in/be_kind_of.rb +5 -1
  25. data/lib/rspec/matchers/built_in/be_within.rb +5 -12
  26. data/lib/rspec/matchers/built_in/change.rb +171 -63
  27. data/lib/rspec/matchers/built_in/compound.rb +201 -30
  28. data/lib/rspec/matchers/built_in/contain_exactly.rb +73 -12
  29. data/lib/rspec/matchers/built_in/count_expectation.rb +169 -0
  30. data/lib/rspec/matchers/built_in/eq.rb +3 -38
  31. data/lib/rspec/matchers/built_in/eql.rb +2 -2
  32. data/lib/rspec/matchers/built_in/equal.rb +3 -3
  33. data/lib/rspec/matchers/built_in/exist.rb +7 -3
  34. data/lib/rspec/matchers/built_in/has.rb +93 -30
  35. data/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
  36. data/lib/rspec/matchers/built_in/include.rb +133 -25
  37. data/lib/rspec/matchers/built_in/match.rb +79 -2
  38. data/lib/rspec/matchers/built_in/operators.rb +14 -5
  39. data/lib/rspec/matchers/built_in/output.rb +59 -2
  40. data/lib/rspec/matchers/built_in/raise_error.rb +130 -27
  41. data/lib/rspec/matchers/built_in/respond_to.rb +117 -15
  42. data/lib/rspec/matchers/built_in/satisfy.rb +28 -14
  43. data/lib/rspec/matchers/built_in/{start_and_end_with.rb → start_or_end_with.rb} +20 -8
  44. data/lib/rspec/matchers/built_in/throw_symbol.rb +15 -5
  45. data/lib/rspec/matchers/built_in/yield.rb +129 -156
  46. data/lib/rspec/matchers/built_in.rb +5 -3
  47. data/lib/rspec/matchers/composable.rb +24 -36
  48. data/lib/rspec/matchers/dsl.rb +203 -37
  49. data/lib/rspec/matchers/english_phrasing.rb +58 -0
  50. data/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +82 -0
  51. data/lib/rspec/matchers/fail_matchers.rb +42 -0
  52. data/lib/rspec/matchers/generated_descriptions.rb +1 -2
  53. data/lib/rspec/matchers/matcher_delegator.rb +3 -4
  54. data/lib/rspec/matchers/matcher_protocol.rb +105 -0
  55. data/lib/rspec/matchers.rb +267 -144
  56. data.tar.gz.sig +0 -0
  57. metadata +71 -49
  58. metadata.gz.sig +0 -0
  59. 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.0.4
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
- MIIDjjCCAnagAwIBAgIB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bj
43
+ Akt00cIlNSplL6DenIAKSh5kF7s0tRD0tC3bNkZmNjNGkdoGEcUODEpTB3RHKKiu
44
+ e6k2Jg6m00z5vGFQhOnROG/QaUzMA3A3mFBe1RHFo07xd0pFeoeWL3vF69Gx9Jwp
45
+ ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
46
+ F3MdtaDehhjC
35
47
  -----END CERTIFICATE-----
36
- date: 2014-08-14 00:00:00.000000000 Z
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.0.0
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.0.0
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: rake
85
+ name: aruba
74
86
  requirement: !ruby/object:Gem::Requirement
75
87
  requirements:
76
88
  - - "~>"
77
89
  - !ruby/object:Gem::Version
78
- version: 10.0.0
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: 10.0.0
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: aruba
113
+ name: minitest
102
114
  requirement: !ruby/object:Gem::Requirement
103
115
  requirements:
104
116
  - - "~>"
105
117
  - !ruby/object:Gem::Version
106
- version: '0.5'
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: '0.5'
125
+ version: '5.2'
114
126
  - !ruby/object:Gem::Dependency
115
- name: minitest
127
+ name: rake
116
128
  requirement: !ruby/object:Gem::Requirement
117
129
  requirements:
118
- - - "~>"
130
+ - - ">"
119
131
  - !ruby/object:Gem::Version
120
- version: '5.2'
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: '5.2'
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
- - License.txt
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/start_and_end_with.rb
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/pretty.rb
182
- homepage: http://github.com/rspec/rspec-expectations
200
+ - lib/rspec/matchers/matcher_protocol.rb
201
+ homepage: https://github.com/rspec/rspec-expectations
183
202
  licenses:
184
203
  - MIT
185
- metadata: {}
186
- post_install_message:
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
- rubyforge_project: rspec
203
- rubygems_version: 2.2.2
204
- signing_key:
226
+ rubygems_version: 3.3.26
227
+ signing_key:
205
228
  specification_version: 4
206
- summary: rspec-expectations-3.0.4
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