rspec-support 3.10.3 → 3.13.6
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 +148 -53
- data/README.md +1 -1
- data/lib/rspec/support/caller_filter.rb +4 -2
- data/lib/rspec/support/comparable_version.rb +3 -1
- data/lib/rspec/support/differ.rb +6 -5
- data/lib/rspec/support/directory_maker.rb +2 -0
- data/lib/rspec/support/encoded_string.rb +5 -3
- data/lib/rspec/support/fuzzy_matcher.rb +2 -0
- data/lib/rspec/support/hunk_generator.rb +2 -0
- data/lib/rspec/support/matcher_definition.rb +2 -0
- data/lib/rspec/support/method_signature_verifier.rb +43 -14
- data/lib/rspec/support/mutex.rb +3 -1
- data/lib/rspec/support/object_formatter.rb +4 -0
- data/lib/rspec/support/recursive_const_methods.rb +2 -0
- data/lib/rspec/support/reentrant_mutex.rb +3 -1
- data/lib/rspec/support/ruby_features.rb +30 -0
- data/lib/rspec/support/source/location.rb +2 -0
- data/lib/rspec/support/source/node.rb +2 -0
- data/lib/rspec/support/source/token.rb +2 -0
- data/lib/rspec/support/source.rb +2 -0
- data/lib/rspec/support/spec/deprecation_helpers.rb +2 -0
- data/lib/rspec/support/spec/diff_helpers.rb +16 -2
- data/lib/rspec/support/spec/formatting_support.rb +2 -0
- data/lib/rspec/support/spec/in_sub_process.rb +7 -1
- data/lib/rspec/support/spec/library_wide_checks.rb +2 -0
- data/lib/rspec/support/spec/shell_out.rb +10 -0
- data/lib/rspec/support/spec/stderr_splitter.rb +3 -1
- data/lib/rspec/support/spec/string_matcher.rb +2 -0
- data/lib/rspec/support/spec/with_isolated_directory.rb +2 -0
- data/lib/rspec/support/spec/with_isolated_stderr.rb +2 -0
- data/lib/rspec/support/spec.rb +2 -0
- data/lib/rspec/support/version.rb +3 -1
- data/lib/rspec/support/warnings.rb +2 -0
- data/lib/rspec/support/with_keywords_when_needed.rb +3 -1
- data/lib/rspec/support.rb +11 -2
- data.tar.gz.sig +0 -0
- metadata +25 -28
- 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: d35005fb4ae66fc37f335b75f5e4110d13bb44227d4b6a884b7a9824e808d960
|
4
|
+
data.tar.gz: 565ad2fb924d29c20b92361a7f6551862caac886a4b2126e166debd798d8f79b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465f5fc672b71a77d5c4b12eb4fae9033bfa8462ab923b555b25f07b9d5014a283016858eede89d6e9a90487b03cb0efc7bde68d8b1d661a1128978ec36a82af
|
7
|
+
data.tar.gz: bc449675ed83f62b5764f09c2dd270d26d9cdfeaa2bdd85cf458588358ed3e0733831c5d2e47140ce626714465f5ca3ca3101e6efda804af9808bc2d8d2ce5a9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,12 +1,107 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](https://github.com/rspec/rspec/compare/rspec-support-v3.13.6...3-13-maintenance)
|
3
|
+
|
4
|
+
### 3.13.6
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec/compare/rspec-support-v3.13.5...rspec-support-v3.13.6)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Change `RSpec::Support::HunkGenerator` to autoload rather than manual require, avoids
|
10
|
+
a load order issue. (Jon Rowe, rspec/rspec#249)
|
11
|
+
|
12
|
+
### 3.13.5
|
13
|
+
[Full Changelog](http://github.com/rspec/rspec/compare/rspec-support-v3.13.4...rspec-support-v3.13.5)
|
14
|
+
|
15
|
+
Bug Fixes:
|
16
|
+
|
17
|
+
* Fix regression in `RSpec::Support::MethodSignature` where positional argument arity confused
|
18
|
+
a check for keyword arguments, meaning a hash would be wrongly detected as keyword arguments
|
19
|
+
when it should have been a positional argument. (Malcolm O'Hare, rspec/rspec#121)
|
20
|
+
|
21
|
+
### 3.13.4
|
22
|
+
[Full Changelog](http://github.com/rspec/rspec/compare/rspec-support-v3.13.3...rspec-support-v3.13.4)
|
23
|
+
|
24
|
+
Bug Fixes:
|
25
|
+
|
26
|
+
* Fix homepage link in gemspec. (Jon Rowe)
|
27
|
+
|
28
|
+
### 3.13.3 / 2025-04-30
|
29
|
+
[Full Changelog](http://github.com/rspec/rspec/compare/rspec-support-v3.13.2...rspec-support-v3.13.3)
|
30
|
+
|
31
|
+
Bug Fixes:
|
32
|
+
|
33
|
+
* Support for changes in diff-lcs and Ruby 3.4 in spec helpers. (Jon Rowe, #164 etc)
|
34
|
+
|
35
|
+
### 3.13.2 / 2024-12-02
|
36
|
+
[Full Changelog](http://github.com/rspec/rspec/compare/rspec-support-v3.13.1...rspec-support-v3.13.2)
|
37
|
+
|
38
|
+
No changes. Released during the monorepo migration to test release processes, but accidentally
|
39
|
+
contained no changes.
|
40
|
+
|
41
|
+
### 3.13.1 / 2024-02-23
|
42
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.13.0...v3.13.1)
|
43
|
+
|
44
|
+
Bug Fixes:
|
45
|
+
|
46
|
+
* Exclude ruby internal require warnings from `RSpec::Support::CallerFilter#first_non_rspec_line`.
|
47
|
+
(Jon Rowe, rspec/rspec-support#593)
|
48
|
+
|
49
|
+
### 3.13.0 / 2024-02-04
|
50
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.12.2...v3.13.0)
|
51
|
+
|
52
|
+
Enchancements
|
53
|
+
|
54
|
+
* Add `RubyFeatures#supports_syntax_suggest?`. (Jon Rowe, rspec/rspec-support#571)
|
55
|
+
|
56
|
+
Bug Fixes:
|
57
|
+
|
58
|
+
* Allow string keys for keyword arguments during verification of method
|
59
|
+
signatures, (but only on Ruby 3+). (@malcolmohare, rspec/rspec-support#591)
|
60
|
+
|
61
|
+
### 3.12.2 / 2024-02-04
|
62
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.12.1...v3.12.2)
|
63
|
+
|
64
|
+
Bug Fixes:
|
65
|
+
|
66
|
+
* Properly surface errors from `in_sub_process`. (Jon Rowe, rspec/rspec-support#575)
|
67
|
+
* Add magic comment for freezing string literals. (Josh Nichols, rspec/rspec-support#586)
|
68
|
+
|
69
|
+
### 3.12.1 / 2023-06-26
|
70
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.12.0...v3.12.1)
|
71
|
+
|
72
|
+
Bug Fixes:
|
73
|
+
|
74
|
+
* Fix `RSpec::Support.thread_local_data` to be Thread local but not Fiber local.
|
75
|
+
(Jon Rowe, rspec/rspec-support#581)
|
76
|
+
|
77
|
+
### 3.12.0 / 2022-10-26
|
78
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.1...v3.12.0)
|
79
|
+
Enhancements:
|
80
|
+
|
81
|
+
* Add `RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash?`
|
82
|
+
(Jean byroot Boussier, rspec/rspec-support#535)
|
83
|
+
|
84
|
+
### 3.11.1 / 2022-09-12
|
85
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.0...v3.11.1)
|
86
|
+
|
87
|
+
Bug Fixes:
|
88
|
+
|
89
|
+
* Fix ripper detection on TruffleRuby. (Brandon Fish, rspec/rspec-support#541)
|
90
|
+
|
91
|
+
### 3.11.0 / 2022-02-09
|
92
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.3...v3.11.0)
|
93
|
+
|
94
|
+
No changes. Released to support other RSpec releases.
|
95
|
+
|
1
96
|
### 3.10.3 / 2021-11-03
|
2
97
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.2...v3.10.3)
|
3
98
|
|
4
99
|
Bug Fixes:
|
5
100
|
|
6
101
|
* Use `Mutex#owned?` to allow `RSpec::Support::ReentrantMutex` to work in
|
7
|
-
nested Fibers on Ruby 3.0 and later. (Benoit Daloze, #503, #504)
|
102
|
+
nested Fibers on Ruby 3.0 and later. (Benoit Daloze, rspec/rspec-support#503, rspec/rspec-support#504)
|
8
103
|
* Support `end`-less methods in `RSpec::Support::Source::Token`
|
9
|
-
so that RSpec won't hang when an `end`-less method raises an error. (Yuji Nakayama, #505)
|
104
|
+
so that RSpec won't hang when an `end`-less method raises an error. (Yuji Nakayama, rspec/rspec-support#505)
|
10
105
|
|
11
106
|
### 3.10.2 / 2021-01-28
|
12
107
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.1...v3.10.2)
|
@@ -14,7 +109,7 @@ Bug Fixes:
|
|
14
109
|
Bug Fixes:
|
15
110
|
|
16
111
|
* Fix issue with `RSpec::Support.define_optimized_require_for_rspec` on JRuby
|
17
|
-
9.1.17.0 (Jon Rowe, #492)
|
112
|
+
9.1.17.0 (Jon Rowe, rspec/rspec-support#492)
|
18
113
|
|
19
114
|
### 3.10.1 / 2020-12-27
|
20
115
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.0...v3.10.1)
|
@@ -22,7 +117,7 @@ Bug Fixes:
|
|
22
117
|
Bug Fixes:
|
23
118
|
|
24
119
|
* Fix deprecation expectations to fail correctly when
|
25
|
-
asserting on messages. (Phil Pirozhkov, #453)
|
120
|
+
asserting on messages. (Phil Pirozhkov, rspec/rspec-support#453)
|
26
121
|
|
27
122
|
### 3.10.0 / 2020-10-30
|
28
123
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.4...v3.10.0)
|
@@ -34,26 +129,26 @@ No changes. Released to support other RSpec releases.
|
|
34
129
|
|
35
130
|
Bug Fixes:
|
36
131
|
|
37
|
-
* Flag ripper as supported on Truffle Ruby. (Brandon Fish, #427)
|
132
|
+
* Flag ripper as supported on Truffle Ruby. (Brandon Fish, rspec/rspec-support#427)
|
38
133
|
* Prevent stubbing `File.read` from breaking source extraction.
|
39
|
-
(Jon Rowe, #431)
|
134
|
+
(Jon Rowe, rspec/rspec-support#431)
|
40
135
|
|
41
136
|
### 3.9.3 / 2020-05-02
|
42
137
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.2...v3.9.3)
|
43
138
|
|
44
139
|
Bug Fixes:
|
45
140
|
|
46
|
-
* Mark ripper as unsupported on Truffle Ruby. (Brandon Fish, #395)
|
47
|
-
* Mark ripper as unsupported on JRuby 9.2.0.0. (Brian Hawley, #400)
|
141
|
+
* Mark ripper as unsupported on Truffle Ruby. (Brandon Fish, rspec/rspec-support#395)
|
142
|
+
* Mark ripper as unsupported on JRuby 9.2.0.0. (Brian Hawley, rspec/rspec-support#400)
|
48
143
|
* Capture `Mutex.new` for our `RSpec::Support:Mutex` in order to
|
49
|
-
allow stubbing `Mutex.new`. (Jon Rowe, #411)
|
144
|
+
allow stubbing `Mutex.new`. (Jon Rowe, rspec/rspec-support#411)
|
50
145
|
|
51
146
|
### 3.9.2 / 2019-12-30
|
52
147
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.1...v3.9.2)
|
53
148
|
|
54
149
|
Bug Fixes:
|
55
150
|
|
56
|
-
* Remove unneeded eval. (Matijs van Zuijlen, #394)
|
151
|
+
* Remove unneeded eval. (Matijs van Zuijlen, rspec/rspec-support#394)
|
57
152
|
|
58
153
|
### 3.9.1 / 2019-12-28
|
59
154
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.0...v3.9.1)
|
@@ -61,7 +156,7 @@ Bug Fixes:
|
|
61
156
|
Bug Fixes:
|
62
157
|
|
63
158
|
* Remove warning caused by keyword arguments on Ruby 2.7.0.
|
64
|
-
(Jon Rowe, #392)
|
159
|
+
(Jon Rowe, rspec/rspec-support#392)
|
65
160
|
|
66
161
|
### 3.9.0 / 2019-10-07
|
67
162
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.3...v3.9.0)
|
@@ -76,9 +171,9 @@ Version 3.9.0 was released to allow other RSpec gems to release 3.9.0.
|
|
76
171
|
Bug Fixes:
|
77
172
|
|
78
173
|
* Escape \r when outputting strings inside arrays.
|
79
|
-
(Tomita Masahiro, Jon Rowe, #378)
|
174
|
+
(Tomita Masahiro, Jon Rowe, rspec/rspec-support#378)
|
80
175
|
* Ensure that optional hash arguments are recognised correctly vs keyword
|
81
|
-
arguments. (Evgeni Dzhelyov, #366)
|
176
|
+
arguments. (Evgeni Dzhelyov, rspec/rspec-support#366)
|
82
177
|
|
83
178
|
### 3.8.2 / 2019-06-10
|
84
179
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.1...v3.8.2)
|
@@ -86,9 +181,9 @@ Bug Fixes:
|
|
86
181
|
Bug Fixes:
|
87
182
|
|
88
183
|
* Ensure that an empty hash is recognised as empty keyword arguments when
|
89
|
-
applicable. (Thomas Walpole, #375)
|
184
|
+
applicable. (Thomas Walpole, rspec/rspec-support#375)
|
90
185
|
* Ensure that diffing truthy values produce diffs consistently.
|
91
|
-
(Lucas Nestor, #377)
|
186
|
+
(Lucas Nestor, rspec/rspec-support#377)
|
92
187
|
|
93
188
|
### 3.8.1 / 2019-03-03
|
94
189
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.0...v3.8.1)
|
@@ -96,7 +191,7 @@ Bug Fixes:
|
|
96
191
|
Bug Fixes:
|
97
192
|
|
98
193
|
* Ensure that inspecting a `SimpleDelegator` based object works regardless of
|
99
|
-
|
194
|
+
visibility of the `__getobj__` method. (Jon Rowe, rspec/rspec-support#369)
|
100
195
|
|
101
196
|
### 3.8.0 / 2018-08-04
|
102
197
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.7.1...v3.8.0)
|
@@ -104,7 +199,7 @@ Bug Fixes:
|
|
104
199
|
Bug Fixes:
|
105
200
|
|
106
201
|
* Order hash keys before diffing to improve diff accuracy when using mocked calls.
|
107
|
-
(James Crisp, #334)
|
202
|
+
(James Crisp, rspec/rspec-support#334)
|
108
203
|
|
109
204
|
### 3.7.1 / 2018-01-29
|
110
205
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.7.0...v3.7.1)
|
@@ -112,7 +207,7 @@ Bug Fixes:
|
|
112
207
|
Bug Fixes:
|
113
208
|
|
114
209
|
* Fix source extraction logic so that it does not trigger a `SystemStackError`
|
115
|
-
when processing deeply nested example groups. (Craig Bass, #343)
|
210
|
+
when processing deeply nested example groups. (Craig Bass, rspec/rspec-support#343)
|
116
211
|
|
117
212
|
### 3.7.0 / 2017-10-17
|
118
213
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0...v3.7.0)
|
@@ -120,21 +215,21 @@ Bug Fixes:
|
|
120
215
|
Enhancements:
|
121
216
|
|
122
217
|
* Improve compatibility with `--enable-frozen-string-literal` option
|
123
|
-
on Ruby 2.3+. (Pat Allan, #320)
|
218
|
+
on Ruby 2.3+. (Pat Allan, rspec/rspec-support#320)
|
124
219
|
* Add `Support.class_of` for extracting class of any object.
|
125
|
-
(Yuji Nakayama, #325)
|
220
|
+
(Yuji Nakayama, rspec/rspec-support#325)
|
126
221
|
|
127
222
|
Bug Fixes:
|
128
223
|
|
129
224
|
* Fix recursive const support to not blow up when given buggy classes
|
130
|
-
that raise odd errors from `#to_str`. (Myron Marston, #317)
|
225
|
+
that raise odd errors from `#to_str`. (Myron Marston, rspec/rspec-support#317)
|
131
226
|
|
132
227
|
### 3.6.0 / 2017-05-04
|
133
228
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta2...3.6.0)
|
134
229
|
|
135
230
|
Enhancements:
|
136
231
|
|
137
|
-
* Import `Source` classes from rspec-core. (Yuji Nakayama, #315)
|
232
|
+
* Import `Source` classes from rspec-core. (Yuji Nakayama, rspec/rspec-support#315)
|
138
233
|
|
139
234
|
### 3.6.0.beta2 / 2016-12-12
|
140
235
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta1...v3.6.0.beta2)
|
@@ -146,7 +241,7 @@ No user-facing changes.
|
|
146
241
|
|
147
242
|
Bug Fixes:
|
148
243
|
|
149
|
-
* Prevent truncated formatted object output from mangling console codes. (#294, Anson Kelly)
|
244
|
+
* Prevent truncated formatted object output from mangling console codes. (rspec/rspec-support#294, Anson Kelly)
|
150
245
|
|
151
246
|
### 3.5.0 / 2016-07-01
|
152
247
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0.beta4...v3.5.0)
|
@@ -157,7 +252,7 @@ Bug Fixes:
|
|
157
252
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0.beta3...v3.5.0.beta4)
|
158
253
|
|
159
254
|
Enhancements:
|
160
|
-
* Improve `MethodSignature` to better support keyword arguments. (#250, Rob Smith).
|
255
|
+
* Improve `MethodSignature` to better support keyword arguments. (rspec/rspec-support#250, Rob Smith).
|
161
256
|
|
162
257
|
### 3.5.0.beta3 / 2016-04-02
|
163
258
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0.beta2...v3.5.0.beta3)
|
@@ -165,12 +260,12 @@ Enhancements:
|
|
165
260
|
Bug Fixes:
|
166
261
|
|
167
262
|
* Fix `EncodedString` to properly handle the behavior of `String#split`
|
168
|
-
on JRuby when the string contains invalid bytes. (Jon Rowe, #268)
|
263
|
+
on JRuby when the string contains invalid bytes. (Jon Rowe, rspec/rspec-support#268)
|
169
264
|
* Fix `ObjectFormatter` so that formatting objects that don't respond to
|
170
265
|
`#inspect` (such as `BasicObject`) does not cause `NoMethodError`.
|
171
|
-
(Yuji Nakayama, #269)
|
266
|
+
(Yuji Nakayama, rspec/rspec-support#269)
|
172
267
|
* Fix `ObjectFormatter` so that formatting recursive array or hash does not
|
173
|
-
cause `SystemStackError`. (Yuji Nakayama, #270, #272)
|
268
|
+
cause `SystemStackError`. (Yuji Nakayama, rspec/rspec-support#270, rspec/rspec-support#272)
|
174
269
|
|
175
270
|
### 3.5.0.beta2 / 2016-03-10
|
176
271
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0.beta1...v3.5.0.beta2)
|
@@ -183,7 +278,7 @@ No user-facing changes.
|
|
183
278
|
Enhancements:
|
184
279
|
|
185
280
|
* Improve formatting of objects by allowing truncation to a pre-configured length.
|
186
|
-
(Liam M, #256)
|
281
|
+
(Liam M, rspec/rspec-support#256)
|
187
282
|
|
188
283
|
### 3.4.1 / 2015-11-20
|
189
284
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.4.0...v3.4.1)
|
@@ -193,27 +288,27 @@ Bug Fixes:
|
|
193
288
|
* Fix `RSpec::Support::RubyFeature.ripper_supported?` so it returns
|
194
289
|
`false` on Rubinius since the Rubinius team has no plans to support
|
195
290
|
it. This prevents rspec-core from trying to load and use ripper to
|
196
|
-
extract failure snippets. (Aaron Stone, #251)
|
291
|
+
extract failure snippets. (Aaron Stone, rspec/rspec-support#251)
|
197
292
|
|
198
293
|
Changes:
|
199
294
|
|
200
|
-
* Remove `VersionChecker` in favor of `ComparableVersion`. (Yuji Nakayama, #266)
|
295
|
+
* Remove `VersionChecker` in favor of `ComparableVersion`. (Yuji Nakayama, rspec/rspec-support#266)
|
201
296
|
|
202
297
|
### 3.4.0 / 2015-11-11
|
203
298
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.3.0...v3.4.0)
|
204
299
|
|
205
300
|
Enhancements:
|
206
301
|
|
207
|
-
* Improve formatting of `Delegator` based objects (e.g. `
|
208
|
-
failure messages and diffs. (Andrew Horner, #215)
|
209
|
-
* Add `ComparableVersion`. (Yuji Nakayama, #245)
|
210
|
-
* Add `Ripper` support detection. (Yuji Nakayama, #245)
|
302
|
+
* Improve formatting of `Delegator` based objects (e.g. `SimpleDelegator`) in
|
303
|
+
failure messages and diffs. (Andrew Horner, rspec/rspec-support#215)
|
304
|
+
* Add `ComparableVersion`. (Yuji Nakayama, rspec/rspec-support#245)
|
305
|
+
* Add `Ripper` support detection. (Yuji Nakayama, rspec/rspec-support#245)
|
211
306
|
|
212
307
|
Bug Fixes:
|
213
308
|
|
214
309
|
* Work around bug in JRuby that reports that `attr_writer` methods
|
215
310
|
have no parameters, causing RSpec's verifying doubles to wrongly
|
216
|
-
fail when mocking or stubbing a writer method on JRuby. (Myron Marston, #225)
|
311
|
+
fail when mocking or stubbing a writer method on JRuby. (Myron Marston, rspec/rspec-support#225)
|
217
312
|
|
218
313
|
### 3.3.0 / 2015-06-12
|
219
314
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.2.2...v3.3.0)
|
@@ -222,8 +317,8 @@ Enhancements:
|
|
222
317
|
|
223
318
|
* Improve formatting of arrays and hashes in failure messages so they
|
224
319
|
use our custom formatting of matchers, time objects, etc.
|
225
|
-
(Myron Marston, Nicholas Chmielewski, #205)
|
226
|
-
* Use improved formatting for diffs as well. (Nicholas Chmielewski, #205)
|
320
|
+
(Myron Marston, Nicholas Chmielewski, rspec/rspec-support#205)
|
321
|
+
* Use improved formatting for diffs as well. (Nicholas Chmielewski, rspec/rspec-support#205)
|
227
322
|
|
228
323
|
Bug Fixes:
|
229
324
|
|
@@ -232,7 +327,7 @@ Bug Fixes:
|
|
232
327
|
`actual` object's `==` is improperly implemented to assume that only
|
233
328
|
objects of the same type will be given. This allows rspec-mocks'
|
234
329
|
`anything` to match against objects with buggy `==` definitions.
|
235
|
-
(Myron Marston, #193)
|
330
|
+
(Myron Marston, rspec/rspec-support#193)
|
236
331
|
|
237
332
|
### 3.2.2 / 2015-02-23
|
238
333
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.2.1...v3.2.2)
|
@@ -240,7 +335,7 @@ Bug Fixes:
|
|
240
335
|
Bug Fixes:
|
241
336
|
|
242
337
|
* Fix an encoding issue with `EncodedString#split` when encountering an
|
243
|
-
invalid byte string. (Benjamin Fleischer, #1760)
|
338
|
+
invalid byte string. (Benjamin Fleischer, rspec/rspec-support#1760)
|
244
339
|
|
245
340
|
### 3.2.1 / 2015-02-04
|
246
341
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.2.0...v3.2.1)
|
@@ -248,20 +343,20 @@ Bug Fixes:
|
|
248
343
|
Bug Fixes:
|
249
344
|
|
250
345
|
* Fix `RSpec::CallerFilter` to work on Rubinius 2.2.
|
251
|
-
(Myron Marston, #169)
|
346
|
+
(Myron Marston, rspec/rspec-support#169)
|
252
347
|
|
253
348
|
### 3.2.0 / 2015-02-03
|
254
349
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.1.2...v3.2.0)
|
255
350
|
|
256
351
|
Enhancements:
|
257
352
|
|
258
|
-
* Add extra Ruby type detection. (Jon Rowe, #133)
|
259
|
-
* Make differ instance re-usable. (Alexey Fedorov, #160)
|
353
|
+
* Add extra Ruby type detection. (Jon Rowe, rspec/rspec-support#133)
|
354
|
+
* Make differ instance re-usable. (Alexey Fedorov, rspec/rspec-support#160)
|
260
355
|
|
261
356
|
Bug Fixes:
|
262
357
|
|
263
358
|
* Do not consider `[]` and `{}` to match when performing fuzzy matching.
|
264
|
-
(Myron Marston, #157)
|
359
|
+
(Myron Marston, rspec/rspec-support#157)
|
265
360
|
|
266
361
|
### 3.1.2 / 2014-10-08
|
267
362
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.1.1...v3.1.2)
|
@@ -269,7 +364,7 @@ Bug Fixes:
|
|
269
364
|
Bug Fixes:
|
270
365
|
|
271
366
|
* Fix method signature to not blow up with a `NoMethodError` on 1.8.7 when
|
272
|
-
verifying against an RSpec matcher. (Myron Marston, #116)
|
367
|
+
verifying against an RSpec matcher. (Myron Marston, rspec/rspec-support#116)
|
273
368
|
|
274
369
|
### 3.1.1 / 2014-09-26
|
275
370
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.1.0...v3.1.1)
|
@@ -278,7 +373,7 @@ Bug Fixes:
|
|
278
373
|
|
279
374
|
* Fix `RSpec::Support::DirectoryMaker` (used by `rspec --init` and
|
280
375
|
`rails generate rspec:install`) so that it detects absolute paths
|
281
|
-
on Windows properly. (Scott Archer, #107, #108, #109) (Jon Rowe, #110)
|
376
|
+
on Windows properly. (Scott Archer, rspec/rspec-support#107, rspec/rspec-support#108, rspec/rspec-support#109) (Jon Rowe, rspec/rspec-support#110)
|
282
377
|
|
283
378
|
### 3.1.0 / 2014-09-04
|
284
379
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.4...v3.1.0)
|
@@ -286,9 +381,9 @@ Bug Fixes:
|
|
286
381
|
Bug Fixes:
|
287
382
|
|
288
383
|
* Fix `FuzzyMatcher` so that it does not wrongly match a struct against
|
289
|
-
an array. (Myron Marston, #97)
|
384
|
+
an array. (Myron Marston, rspec/rspec-support#97)
|
290
385
|
* Prevent infinitely recursing `#flatten` methods from causing the differ
|
291
|
-
to hang. (Jon Rowe, #101)
|
386
|
+
to hang. (Jon Rowe, rspec/rspec-support#101)
|
292
387
|
|
293
388
|
### 3.0.4 / 2014-08-14
|
294
389
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.3...v3.0.4)
|
@@ -296,7 +391,7 @@ Bug Fixes:
|
|
296
391
|
Bug Fixes:
|
297
392
|
|
298
393
|
* Fix `FuzzyMatcher` so that it does not silence `ArgumentError` raised
|
299
|
-
from broken implementations of `==`. (Myron Marston, #94)
|
394
|
+
from broken implementations of `==`. (Myron Marston, rspec/rspec-support#94)
|
300
395
|
|
301
396
|
### 3.0.3 / 2014-07-21
|
302
397
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.2...v3.0.3)
|
@@ -305,23 +400,23 @@ Bug Fixes:
|
|
305
400
|
|
306
401
|
* Fix regression in `Support#method_handle_for` where proxy objects
|
307
402
|
with method delegated would wrongly not return a method handle.
|
308
|
-
(Jon Rowe, #90)
|
309
|
-
* Properly detect Module#prepend support in Ruby 2.1+ (Ben Langfeld, #91)
|
403
|
+
(Jon Rowe, rspec/rspec-support#90)
|
404
|
+
* Properly detect Module#prepend support in Ruby 2.1+ (Ben Langfeld, rspec/rspec-support#91)
|
310
405
|
* Fix `rspec/support/warnings.rb` so it can be loaded and used in
|
311
|
-
isolation. (Myron Marston, #93)
|
406
|
+
isolation. (Myron Marston, rspec/rspec-support#93)
|
312
407
|
|
313
408
|
### 3.0.2 / 2014-06-20
|
314
409
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.1...v3.0.2)
|
315
410
|
|
316
411
|
* Revert `BlockSignature` change from 3.0.1 because of a ruby bug that
|
317
412
|
caused it to change the block's behavior (https://bugs.ruby-lang.org/issues/9967).
|
318
|
-
(Myron Marston, rspec-
|
413
|
+
(Myron Marston, rspec-mocksrspec/rspec-support#721)
|
319
414
|
|
320
415
|
### 3.0.1 / 2014-06-19
|
321
416
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.0...v3.0.1)
|
322
417
|
|
323
418
|
* Fix `BlockSignature` so that it correctly differentiates between
|
324
|
-
required and optional block args. (Myron Marston, rspec-
|
419
|
+
required and optional block args. (Myron Marston, rspec-mocksrspec/rspec-support#714)
|
325
420
|
|
326
421
|
### 3.0.0 / 2014-06-01
|
327
422
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.0.rc1...v3.0.0)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RSpec::Support [](https://github.com/rspec/rspec-support/actions)
|
2
2
|
|
3
3
|
`RSpec::Support` provides common functionality to `RSpec::Core`,
|
4
4
|
`RSpec::Expectations` and `RSpec::Mocks`. It is considered
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Support.require_rspec_support "ruby_features"
|
2
4
|
|
3
5
|
module RSpec
|
@@ -25,7 +27,7 @@ module RSpec
|
|
25
27
|
# when `CallerFilter.first_non_rspec_line` is called from the top level of a required
|
26
28
|
# file, but it depends on if rubygems is loaded or not. We don't want to have to deal
|
27
29
|
# with this complexity in our `RSpec.deprecate` calls, so we ignore it here.
|
28
|
-
IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb")
|
30
|
+
IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb", "<internal:", %r{/lib/ruby/[^/]+/bundled_gems\.rb})
|
29
31
|
|
30
32
|
if RSpec::Support::RubyFeatures.caller_locations_supported?
|
31
33
|
# This supports args because it's more efficient when the caller specifies
|
@@ -34,7 +36,7 @@ module RSpec
|
|
34
36
|
# be found in a small number of stack frames from `skip_frames`.
|
35
37
|
#
|
36
38
|
# Note that there is a risk to passing a `skip_frames` value that is too high:
|
37
|
-
# If it
|
39
|
+
# If it skipped the first non-rspec line, then this method would return the
|
38
40
|
# 2nd or 3rd (or whatever) non-rspec line. Thus, you generally shouldn't pass
|
39
41
|
# values for these parameters, particularly since most places that use this are
|
40
42
|
# not hot spots (generally it gets used for deprecation warnings). However,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Support
|
3
5
|
# @private
|
@@ -10,7 +12,7 @@ module RSpec
|
|
10
12
|
@string = string
|
11
13
|
end
|
12
14
|
|
13
|
-
def <=>(other)
|
15
|
+
def <=>(other)
|
14
16
|
other = self.class.new(other) unless other.is_a?(self.class)
|
15
17
|
|
16
18
|
return 0 if string == other.string
|
data/lib/rspec/support/differ.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Support.require_rspec_support 'encoded_string'
|
2
|
-
RSpec::Support.require_rspec_support 'hunk_generator'
|
3
4
|
RSpec::Support.require_rspec_support "object_formatter"
|
4
5
|
|
5
6
|
require 'pp'
|
6
7
|
|
7
8
|
module RSpec
|
8
9
|
module Support
|
9
|
-
# rubocop:disable ClassLength
|
10
|
+
# rubocop:disable Metrics/ClassLength
|
10
11
|
class Differ
|
11
12
|
def diff(actual, expected)
|
12
13
|
diff = ""
|
@@ -24,7 +25,7 @@ module RSpec
|
|
24
25
|
diff.to_s
|
25
26
|
end
|
26
27
|
|
27
|
-
# rubocop:disable MethodLength
|
28
|
+
# rubocop:disable Metrics/MethodLength
|
28
29
|
def diff_as_string(actual, expected)
|
29
30
|
encoding = EncodedString.pick_encoding(actual, expected)
|
30
31
|
|
@@ -52,7 +53,7 @@ module RSpec
|
|
52
53
|
rescue Encoding::CompatibilityError
|
53
54
|
handle_encoding_errors(actual, expected)
|
54
55
|
end
|
55
|
-
# rubocop:enable MethodLength
|
56
|
+
# rubocop:enable Metrics/MethodLength
|
56
57
|
|
57
58
|
def diff_as_object(actual, expected)
|
58
59
|
actual_as_string = object_to_string(actual)
|
@@ -210,6 +211,6 @@ module RSpec
|
|
210
211
|
end
|
211
212
|
end
|
212
213
|
end
|
213
|
-
# rubocop:enable ClassLength
|
214
|
+
# rubocop:enable Metrics/ClassLength
|
214
215
|
end
|
215
216
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Support
|
3
5
|
# @private
|
@@ -60,7 +62,7 @@ module RSpec
|
|
60
62
|
# vs "\x80".encode('UTF-8','ASCII-8BIT', undef: :replace, replace: '<undef>')
|
61
63
|
# # => '<undef>'
|
62
64
|
# Encoding::CompatibilityError
|
63
|
-
# when Encoding.
|
65
|
+
# when Encoding.compatible?(str1, str2) is nil
|
64
66
|
# e.g. utf_16le_emoji_string.split("\n")
|
65
67
|
# e.g. valid_unicode_string.encode(utf8_encoding) << ascii_string
|
66
68
|
# Encoding::InvalidByteSequenceError:
|
@@ -92,7 +94,7 @@ module RSpec
|
|
92
94
|
string = remove_invalid_bytes(string)
|
93
95
|
string.encode(@encoding)
|
94
96
|
rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
|
95
|
-
# Originally defined as a constant to avoid
|
97
|
+
# Originally defined as a constant to avoid unneeded allocations, this hash must
|
96
98
|
# be defined inline (without {}) to avoid warnings on Ruby 2.7
|
97
99
|
#
|
98
100
|
# In MRI 2.1 'invalid: :replace' changed to also replace an invalid byte sequence
|
@@ -108,7 +110,7 @@ module RSpec
|
|
108
110
|
#
|
109
111
|
string.encode(@encoding, :invalid => :replace, :undef => :replace, :replace => REPLACE)
|
110
112
|
rescue Encoding::ConverterNotFoundError
|
111
|
-
# Originally defined as a constant to avoid
|
113
|
+
# Originally defined as a constant to avoid unneeded allocations, this hash must
|
112
114
|
# be defined inline (without {}) to avoid warnings on Ruby 2.7
|
113
115
|
string.dup.force_encoding(@encoding).encode(:invalid => :replace, :replace => REPLACE)
|
114
116
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rspec/support'
|
2
4
|
RSpec::Support.require_rspec_support "ruby_features"
|
3
5
|
RSpec::Support.require_rspec_support "matcher_definition"
|
@@ -8,7 +10,7 @@ module RSpec
|
|
8
10
|
# keyword args of a given method.
|
9
11
|
#
|
10
12
|
# @private
|
11
|
-
class MethodSignature # rubocop:disable ClassLength
|
13
|
+
class MethodSignature # rubocop:disable Metrics/ClassLength
|
12
14
|
attr_reader :min_non_kw_args, :max_non_kw_args, :optional_kw_args, :required_kw_args
|
13
15
|
|
14
16
|
def initialize(method)
|
@@ -77,12 +79,37 @@ module RSpec
|
|
77
79
|
given_kw_args - @allowed_kw_args
|
78
80
|
end
|
79
81
|
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
could_contain_kw_args?(args)
|
85
|
-
|
82
|
+
# Considering the arg types, are there kw_args?
|
83
|
+
if RubyFeatures.kw_arg_separation?
|
84
|
+
def has_kw_args_in?(args)
|
85
|
+
# If the last arg is a hash, depending on the signature it could be kw_args or a positional parameter.
|
86
|
+
return false unless Hash === args.last && could_contain_kw_args?(args)
|
87
|
+
|
88
|
+
# If the position of the hash is beyond the count of required and optional positional
|
89
|
+
# args then it is the kwargs hash
|
90
|
+
return true if args.count > @max_non_kw_args
|
91
|
+
|
92
|
+
# This is the proper way to disambiguate between positional args and keywords hash
|
93
|
+
# but relies on beginning of the call chain annotating the method with
|
94
|
+
# ruby2_keywords, so only use it for positive feedback as without the annotation
|
95
|
+
# this is always false
|
96
|
+
return true if Hash.ruby2_keywords_hash?(args[-1])
|
97
|
+
|
98
|
+
# Otherwise, the hash could be defined kw_args or an optional positional parameter
|
99
|
+
# inspect the keys against known kwargs to determine what it is
|
100
|
+
# Note: the problem with this is that if a user passes only invalid keyword args,
|
101
|
+
# rspec no longer detects is and will assign this to a positional argument
|
102
|
+
return arbitrary_kw_args? || args.last.keys.all? { |x| @allowed_kw_args.include?(x) }
|
103
|
+
end
|
104
|
+
else
|
105
|
+
def has_kw_args_in?(args)
|
106
|
+
# Version <= Ruby 2.7
|
107
|
+
# If the last argument is Hash, Ruby will treat only symbol keys as keyword arguments
|
108
|
+
# the rest will be grouped in another Hash and passed as positional argument.
|
109
|
+
Hash === args.last &&
|
110
|
+
could_contain_kw_args?(args) &&
|
111
|
+
(args.last.empty? || args.last.keys.any? { |x| x.is_a?(Symbol) })
|
112
|
+
end
|
86
113
|
end
|
87
114
|
|
88
115
|
# Without considering what the last arg is, could it
|
@@ -280,12 +307,12 @@ module RSpec
|
|
280
307
|
|
281
308
|
def initialize(signature, args=[])
|
282
309
|
@signature = signature
|
283
|
-
@non_kw_args, @kw_args = split_args(
|
310
|
+
@non_kw_args, @kw_args = split_args(args.clone)
|
284
311
|
@min_non_kw_args = @max_non_kw_args = @non_kw_args
|
285
312
|
@arbitrary_kw_args = @unlimited_args = false
|
286
313
|
end
|
287
314
|
|
288
|
-
def with_expectation(expectation) # rubocop:disable
|
315
|
+
def with_expectation(expectation) # rubocop:disable Metrics/MethodLength
|
289
316
|
return self unless MethodSignatureExpectation === expectation
|
290
317
|
|
291
318
|
if expectation.empty?
|
@@ -360,8 +387,8 @@ module RSpec
|
|
360
387
|
!@unlimited_args || @signature.unlimited_args?
|
361
388
|
end
|
362
389
|
|
363
|
-
def split_args(
|
364
|
-
kw_args = if @signature.has_kw_args_in?(args)
|
390
|
+
def split_args(args)
|
391
|
+
kw_args = if @signature.has_kw_args_in?(args) && !RubyFeatures.kw_arg_separation?
|
365
392
|
last = args.pop
|
366
393
|
non_kw_args = last.reject { |k, _| k.is_a?(Symbol) }
|
367
394
|
if non_kw_args.empty?
|
@@ -370,6 +397,8 @@ module RSpec
|
|
370
397
|
args << non_kw_args
|
371
398
|
last.select { |k, _| k.is_a?(Symbol) }.keys
|
372
399
|
end
|
400
|
+
elsif @signature.has_kw_args_in?(args) && RubyFeatures.kw_arg_separation?
|
401
|
+
args.pop.keys
|
373
402
|
else
|
374
403
|
[]
|
375
404
|
end
|
@@ -378,7 +407,7 @@ module RSpec
|
|
378
407
|
end
|
379
408
|
end
|
380
409
|
|
381
|
-
# Figures out
|
410
|
+
# Figures out whether a given method can accept various arguments.
|
382
411
|
# Surprisingly non-trivial.
|
383
412
|
#
|
384
413
|
# @private
|
@@ -391,13 +420,13 @@ module RSpec
|
|
391
420
|
class LooseSignatureVerifier < MethodSignatureVerifier
|
392
421
|
private
|
393
422
|
|
394
|
-
def split_args(
|
423
|
+
def split_args(args)
|
395
424
|
if RSpec::Support.is_a_matcher?(args.last) && @signature.could_contain_kw_args?(args)
|
396
425
|
args.pop
|
397
426
|
@signature = SignatureWithKeywordArgumentsMatcher.new(@signature)
|
398
427
|
end
|
399
428
|
|
400
|
-
super(
|
429
|
+
super(args)
|
401
430
|
end
|
402
431
|
|
403
432
|
# If a matcher is used in a signature in place of keyword arguments, all
|
data/lib/rspec/support/mutex.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Support
|
3
5
|
# On 1.8.7, it's in the stdlib.
|
@@ -9,7 +11,7 @@ module RSpec
|
|
9
11
|
# Some methods we don't need are deleted. Anything I don't
|
10
12
|
# understand (there's quite a bit, actually) is left in.
|
11
13
|
#
|
12
|
-
# Some
|
14
|
+
# Some formatting changes are made to appease the robot overlord:
|
13
15
|
# https://travis-ci.org/rspec/rspec-core/jobs/54410874
|
14
16
|
# @private
|
15
17
|
class Mutex
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Support.require_rspec_support 'matcher_definition'
|
2
4
|
|
3
5
|
module RSpec
|
@@ -59,6 +61,8 @@ module RSpec
|
|
59
61
|
prepare_array(object)
|
60
62
|
when Hash
|
61
63
|
prepare_hash(object)
|
64
|
+
when Symbol
|
65
|
+
object
|
62
66
|
else
|
63
67
|
inspector_class = INSPECTOR_CLASSES.find { |inspector| inspector.can_inspect?(object) }
|
64
68
|
inspector_class.new(object, self)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Support
|
3
5
|
# Allows a thread to lock out other threads from a critical section of code,
|
@@ -62,7 +64,7 @@ module RSpec
|
|
62
64
|
# On 1.9 and up, this is in core, so we just use the real one
|
63
65
|
class Mutex < ::Mutex
|
64
66
|
# If you mock Mutex.new you break our usage of Mutex, so
|
65
|
-
# instead we capture the original method to return
|
67
|
+
# instead we capture the original method to return Mutexes.
|
66
68
|
NEW_MUTEX_METHOD = Mutex.method(:new)
|
67
69
|
|
68
70
|
def self.new
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rbconfig'
|
2
4
|
RSpec::Support.require_rspec_support "comparable_version"
|
3
5
|
|
@@ -94,6 +96,27 @@ module RSpec
|
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
99
|
+
if RUBY_VERSION.to_f >= 3.2
|
100
|
+
def supports_syntax_suggest?
|
101
|
+
true
|
102
|
+
end
|
103
|
+
else
|
104
|
+
def supports_syntax_suggest?
|
105
|
+
false
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
if RUBY_VERSION.to_f >= 3.0
|
110
|
+
# https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments
|
111
|
+
def kw_arg_separation?
|
112
|
+
true
|
113
|
+
end
|
114
|
+
else
|
115
|
+
def kw_arg_separation?
|
116
|
+
false
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
97
120
|
if RUBY_VERSION.to_f >= 2.7
|
98
121
|
def supports_taint?
|
99
122
|
false
|
@@ -116,6 +139,9 @@ module RSpec
|
|
116
139
|
ripper_requirements.push(!Ruby.jruby_version.between?('9.0.0.0.rc1', '9.2.0.0'))
|
117
140
|
end
|
118
141
|
|
142
|
+
# TruffleRuby disables ripper due to low performance
|
143
|
+
ripper_requirements.push(false) if Ruby.truffleruby?
|
144
|
+
|
119
145
|
if ripper_requirements.all?
|
120
146
|
def ripper_supported?
|
121
147
|
true
|
@@ -126,6 +152,10 @@ module RSpec
|
|
126
152
|
end
|
127
153
|
end
|
128
154
|
|
155
|
+
def distincts_kw_args_from_positional_hash?
|
156
|
+
RUBY_VERSION >= '3.0.0'
|
157
|
+
end
|
158
|
+
|
129
159
|
if Ruby.mri?
|
130
160
|
def kw_args_supported?
|
131
161
|
RUBY_VERSION >= '2.0.0'
|
data/lib/rspec/support/source.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'diff/lcs'
|
2
4
|
|
3
5
|
module RSpec
|
@@ -10,13 +12,25 @@ module RSpec
|
|
10
12
|
def one_line_header(line_number=2)
|
11
13
|
"-1,#{line_number} +1,#{line_number}"
|
12
14
|
end
|
13
|
-
|
15
|
+
elsif ::Diff::LCS::VERSION.to_f < 1.6
|
14
16
|
def one_line_header(_=2)
|
15
17
|
"-1 +1"
|
16
18
|
end
|
19
|
+
else
|
20
|
+
def one_line_header(line_number=2)
|
21
|
+
if line_number - 1 == 1
|
22
|
+
"-1 +1"
|
23
|
+
else
|
24
|
+
"-1,#{line_number - 1} +1,#{line_number - 1}"
|
25
|
+
end
|
26
|
+
end
|
17
27
|
end
|
18
28
|
|
19
|
-
if Diff::LCS::VERSION.to_f
|
29
|
+
if ::Diff::LCS::VERSION.to_f > 1.5
|
30
|
+
def removing_two_line_header
|
31
|
+
"-1,2 +0,0"
|
32
|
+
end
|
33
|
+
elsif Diff::LCS::VERSION.to_f < 1.4 || Diff::LCS::VERSION >= "1.4.4"
|
20
34
|
def removing_two_line_header
|
21
35
|
"-1,3 +1"
|
22
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Support
|
3
5
|
module InSubProcess
|
@@ -7,10 +9,14 @@ module RSpec
|
|
7
9
|
|
8
10
|
# Useful as a way to isolate a global change to a subprocess.
|
9
11
|
|
10
|
-
def in_sub_process(prevent_warnings=true) # rubocop:disable MethodLength, Metrics/AbcSize
|
12
|
+
def in_sub_process(prevent_warnings=true) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
11
13
|
exception_reader, exception_writer = IO.pipe
|
12
14
|
result_reader, result_writer = IO.pipe
|
13
15
|
|
16
|
+
# Set binary mode to avoid errors surrounding ascii-8bit to utf-8 conversion
|
17
|
+
# this happens with warnings on rspec-rails for example
|
18
|
+
[exception_reader, exception_writer, result_reader, result_writer].each { |io| io.binmode }
|
19
|
+
|
14
20
|
pid = Process.fork do
|
15
21
|
warning_preventer = $stderr = RSpec::Support::StdErrSplitter.new($stderr)
|
16
22
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'open3'
|
2
4
|
require 'rake/file_utils'
|
3
5
|
require 'shellwords'
|
@@ -59,7 +61,9 @@ module RSpec
|
|
59
61
|
%r{bundler/source/rubygems},
|
60
62
|
# Ignore bundler + rubygems warning.
|
61
63
|
%r{site_ruby/\d\.\d\.\d/rubygems},
|
64
|
+
%r{site_ruby/\d\.\d\.\d/bundler},
|
62
65
|
%r{jruby-\d\.\d\.\d+\.\d/lib/ruby/stdlib/rubygems},
|
66
|
+
%r{lib/rubygems/custom_require},
|
63
67
|
# This is required for windows for some reason
|
64
68
|
%r{lib/bundler/rubygems},
|
65
69
|
# This is a JRuby file that generates warnings on 9.0.3.0
|
@@ -77,6 +81,12 @@ module RSpec
|
|
77
81
|
# This is a JRuby 9.2.1.x error
|
78
82
|
%r{jruby/kernel/gem_prelude},
|
79
83
|
%r{lib/jruby\.jar!/jruby/preludes},
|
84
|
+
# Ignore some JRuby errors for gems
|
85
|
+
%r{jruby/\d\.\d(\.\d)?/gems/aruba},
|
86
|
+
%r{jruby/\d\.\d(\.\d)?/gems/ffi},
|
87
|
+
%r{warning: encoding options not supported in 1\.8},
|
88
|
+
# Ignore errors from asdf
|
89
|
+
%r{\.asdf/installs},
|
80
90
|
]
|
81
91
|
|
82
92
|
def strip_known_warnings(input)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'stringio'
|
2
4
|
|
3
5
|
module RSpec
|
@@ -39,7 +41,7 @@ module RSpec
|
|
39
41
|
def write(line)
|
40
42
|
return if line =~ %r{^\S+/gems/\S+:\d+: warning:} # http://rubular.com/r/kqeUIZOfPG
|
41
43
|
|
42
|
-
# Ruby 2.7.0 warnings from keyword
|
44
|
+
# Ruby 2.7.0 warnings from keyword arguments span multiple lines, extend check above
|
43
45
|
# to look for the next line.
|
44
46
|
return if @last_line =~ %r{^\S+/gems/\S+:\d+: warning:} &&
|
45
47
|
line =~ %r{warning: The called method .* is defined here}
|
data/lib/rspec/support/spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Support.require_rspec_support("method_signature_verifier")
|
2
4
|
|
3
5
|
module RSpec
|
@@ -9,7 +11,7 @@ module RSpec
|
|
9
11
|
module_function
|
10
12
|
|
11
13
|
if RSpec::Support::RubyFeatures.kw_args_supported?
|
12
|
-
# Remove this in RSpec 4 in favour of
|
14
|
+
# Remove this in RSpec 4 in favour of explicitly passed in kwargs where
|
13
15
|
# this is used. Works around a warning in Ruby 2.7
|
14
16
|
|
15
17
|
def class_exec(klass, *args, &block)
|
data/lib/rspec/support.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Support
|
3
5
|
# @api private
|
@@ -89,8 +91,14 @@ module RSpec
|
|
89
91
|
end
|
90
92
|
|
91
93
|
# A single thread local variable so we don't excessively pollute that namespace.
|
92
|
-
|
93
|
-
|
94
|
+
if RUBY_VERSION.to_f >= 2
|
95
|
+
def self.thread_local_data
|
96
|
+
Thread.current.thread_variable_get(:__rspec) || Thread.current.thread_variable_set(:__rspec, {})
|
97
|
+
end
|
98
|
+
else
|
99
|
+
def self.thread_local_data
|
100
|
+
Thread.current[:__rspec] ||= {}
|
101
|
+
end
|
94
102
|
end
|
95
103
|
|
96
104
|
# @api private
|
@@ -150,5 +158,6 @@ module RSpec
|
|
150
158
|
# pp, etc by avoiding an unnecessary require. Instead, autoload will take
|
151
159
|
# care of loading the differ on first use.
|
152
160
|
autoload :Differ, "rspec/support/differ"
|
161
|
+
autoload :HunkGenerator, "rspec/support/hunk_generator"
|
153
162
|
end
|
154
163
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.13.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -10,16 +10,15 @@ authors:
|
|
10
10
|
- Sam Phippen
|
11
11
|
- Xaviery Shay
|
12
12
|
- Bradley Schaefer
|
13
|
-
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain:
|
16
15
|
- |
|
17
16
|
-----BEGIN CERTIFICATE-----
|
18
|
-
|
17
|
+
MIIFvjCCA6agAwIBAgIJAPXjfUbCjdXVMA0GCSqGSIb3DQEBCwUAMIGAMQswCQYD
|
19
18
|
VQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEO
|
20
19
|
MAwGA1UECgwFUlNwZWMxEzARBgNVBAMMCnJzcGVjLmluZm8xJTAjBgkqhkiG9w0B
|
21
|
-
|
22
|
-
|
20
|
+
CQEWFnJzcGVjQGdvb2dsZWdyb3Vwcy5jb20wHhcNMjUwMjA2MTE0NjU2WhcNMjYw
|
21
|
+
MjA2MTE0NjU2WjCBgDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24x
|
23
22
|
EDAOBgNVBAcMB1NlYXR0bGUxDjAMBgNVBAoMBVJTcGVjMRMwEQYDVQQDDApyc3Bl
|
24
23
|
Yy5pbmZvMSUwIwYJKoZIhvcNAQkBFhZyc3BlY0Bnb29nbGVncm91cHMuY29tMIIC
|
25
24
|
IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsSmjgcHaKlD0jizRJowi2bGI
|
@@ -33,22 +32,21 @@ cert_chain:
|
|
33
32
|
Xeh3EVdWY3vMB1pkhPwlsenpcmj5gOzrd54lELOVbCGHCf48iSqeflY2Lhe0pvzK
|
34
33
|
blXCJBDmtrebvus291rM/dHcbEfK1SVd5Wut/n131iouf6dnNCFskFygDcgBbthC
|
35
34
|
gpEMqf80lEmhX59VUsm0Pv6OEo+ZPHBvXPiJA6DShQh9t3YtpwyA8uVDMbT/i32u
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
+
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
F3MdtaDehhjC
|
35
|
+
2FUsqZbbJcCmkBrGposCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
36
|
+
HQYDVR0OBBYEFPPvQ5XT0Nvuhi6k+hrWVv35J+TeMA0GCSqGSIb3DQEBCwUAA4IC
|
37
|
+
AQBGBr0ll2yLrkO6IeK5Q7qZFnANaUCKfi6Of9VztZJXgKAU5KAQxyOidGktoA5N
|
38
|
+
lp+bFKudRkW8jSehqoNaNBdSZ9Bc07EGMXIhUFJZF9rq7Z2SKPwUm6EaSsBK13QR
|
39
|
+
U4K6wuaw5ZJSFzklapoGOJRGnFlnNtlhNFY6+tTwCeblwZbcuYGyGY8+Rg7GbyVl
|
40
|
+
3Tr4Gi1aS/qG/MDXKdE8HWm39dmaAMdbw6dg1VBd0JrX2VqH7xvE1dM/D3OlKrNp
|
41
|
+
gNFRNJig3Y8qPjocZR0cGkhgZoC9wribWxHSNawZm4CoV3fja2HNx9QyM7BaB+as
|
42
|
+
yuqAiBbA7vBcyc8nKATip3mxbyXYXoDD7nmO8JCPP7O/WsgG+U/B2a0kPdvYFoxE
|
43
|
+
Q0Js3GtFCuMvL+0rifqdxBOLtu0Pw9q4RvToTJIl2IR6eTgCb82B1hw9qKf7PjuL
|
44
|
+
BoEsYjjDhGw6FZvcJG8O6uj7aB+z4aF21YR74UGL7sq/RIPNNez5JI95jTGfqCPy
|
45
|
+
6yo0w3zja3yg28QK3Fj+tbOHeSLv9SDQWi/1jiPprGzbxGvbVvjvX11YZc46vkmY
|
46
|
+
AwP+qZPPf97FXXZGEGIYhhHpnj+Ltx9nCetRPiZ4rvYBcXgCWVQSg6eiEofrMwn/
|
47
|
+
AKMCABhZ1Y2eATsfMgdkmIZk7JIPZiSi6eUxPiCMP9M/pw==
|
50
48
|
-----END CERTIFICATE-----
|
51
|
-
date:
|
49
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
52
50
|
dependencies:
|
53
51
|
- !ruby/object:Gem::Dependency
|
54
52
|
name: rake
|
@@ -120,16 +118,16 @@ files:
|
|
120
118
|
- lib/rspec/support/version.rb
|
121
119
|
- lib/rspec/support/warnings.rb
|
122
120
|
- lib/rspec/support/with_keywords_when_needed.rb
|
123
|
-
homepage: https://
|
121
|
+
homepage: https://rspec.info
|
124
122
|
licenses:
|
125
123
|
- MIT
|
126
124
|
metadata:
|
127
|
-
bug_tracker_uri: https://github.com/rspec/rspec
|
128
|
-
changelog_uri: https://github.com/rspec/rspec
|
125
|
+
bug_tracker_uri: https://github.com/rspec/rspec/issues
|
126
|
+
changelog_uri: https://github.com/rspec/rspec/blob/rspec-support-v3.13.6/rspec-support/Changelog.md
|
129
127
|
documentation_uri: https://rspec.info/documentation/
|
130
128
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
131
|
-
|
132
|
-
|
129
|
+
rubygems_mfa_required: 'true'
|
130
|
+
source_code_uri: https://github.com/rspec/rspec/blob/rspec-support-v3.13.6/rspec-support
|
133
131
|
rdoc_options:
|
134
132
|
- "--charset=UTF-8"
|
135
133
|
require_paths:
|
@@ -145,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
143
|
- !ruby/object:Gem::Version
|
146
144
|
version: '0'
|
147
145
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
-
signing_key:
|
146
|
+
rubygems_version: 3.6.7
|
150
147
|
specification_version: 4
|
151
|
-
summary: rspec-support-3.
|
148
|
+
summary: rspec-support-3.13.6
|
152
149
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|