rspec-support 3.10.2 → 3.11.1
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 +25 -0
- data/README.md +1 -1
- data/lib/rspec/support/caller_filter.rb +2 -2
- data/lib/rspec/support/comparable_version.rb +1 -1
- data/lib/rspec/support/differ.rb +4 -4
- data/lib/rspec/support/encoded_string.rb +3 -3
- data/lib/rspec/support/method_signature_verifier.rb +2 -2
- data/lib/rspec/support/mutex.rb +1 -1
- data/lib/rspec/support/reentrant_mutex.rb +27 -10
- data/lib/rspec/support/ruby_features.rb +3 -0
- data/lib/rspec/support/source/token.rb +12 -5
- data/lib/rspec/support/spec/in_sub_process.rb +1 -1
- data/lib/rspec/support/spec/stderr_splitter.rb +1 -1
- data/lib/rspec/support/version.rb +1 -1
- data/lib/rspec/support/with_keywords_when_needed.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +8 -8
- 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: 0ab2db5594163c1b2bd0b6f4cc76a7f9450b6b565d0450899ba4763e873b5276
|
4
|
+
data.tar.gz: 0accbb903f580db0cdebdd8bf87f0376652e3504f0d8f6ee743b7a16e8ea8436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bee776ca4085e78b102d014b6e5f065f5b94a17a1f6c1f5f158e3b4a7db6830be5c0c68c782be28657d3c0902a87258b6e952aabcffa38f36eb21f76f98fd4ce
|
7
|
+
data.tar.gz: b9844cbb6dcbfbbcee1b0c0f75cc901454c081b1dd95106fce0a50fbce76a4ba06ca3431b312b6384783134795cc76b28661ca55fd7640a4c0236fbc10c61d9c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.1...3-11-maintenance)
|
3
|
+
|
4
|
+
### 3.11.1 / 2022-09-12
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.0...v3.11.1)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Fix ripper detection on TruffleRuby. (Brandon Fish, #541)
|
10
|
+
|
11
|
+
### 3.11.0 / 2022-02-09
|
12
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.3...v3.11.0)
|
13
|
+
|
14
|
+
No changes. Released to support other RSpec releases.
|
15
|
+
|
16
|
+
### 3.10.3 / 2021-11-03
|
17
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.2...v3.10.3)
|
18
|
+
|
19
|
+
Bug Fixes:
|
20
|
+
|
21
|
+
* Use `Mutex#owned?` to allow `RSpec::Support::ReentrantMutex` to work in
|
22
|
+
nested Fibers on Ruby 3.0 and later. (Benoit Daloze, #503, #504)
|
23
|
+
* Support `end`-less methods in `RSpec::Support::Source::Token`
|
24
|
+
so that RSpec won't hang when an `end`-less method raises an error. (Yuji Nakayama, #505)
|
25
|
+
|
1
26
|
### 3.10.2 / 2021-01-28
|
2
27
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.1...v3.10.2)
|
3
28
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RSpec::Support [![Build Status](https://github.com/rspec/rspec-support/workflows/RSpec%20CI/badge.svg
|
1
|
+
# RSpec::Support [![Build Status](https://github.com/rspec/rspec-support/workflows/RSpec%20CI/badge.svg)](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
|
@@ -25,7 +25,7 @@ module RSpec
|
|
25
25
|
# when `CallerFilter.first_non_rspec_line` is called from the top level of a required
|
26
26
|
# file, but it depends on if rubygems is loaded or not. We don't want to have to deal
|
27
27
|
# 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")
|
28
|
+
IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb", "<internal:")
|
29
29
|
|
30
30
|
if RSpec::Support::RubyFeatures.caller_locations_supported?
|
31
31
|
# This supports args because it's more efficient when the caller specifies
|
@@ -34,7 +34,7 @@ module RSpec
|
|
34
34
|
# be found in a small number of stack frames from `skip_frames`.
|
35
35
|
#
|
36
36
|
# Note that there is a risk to passing a `skip_frames` value that is too high:
|
37
|
-
# If it
|
37
|
+
# If it skipped the first non-rspec line, then this method would return the
|
38
38
|
# 2nd or 3rd (or whatever) non-rspec line. Thus, you generally shouldn't pass
|
39
39
|
# values for these parameters, particularly since most places that use this are
|
40
40
|
# not hot spots (generally it gets used for deprecation warnings). However,
|
data/lib/rspec/support/differ.rb
CHANGED
@@ -6,7 +6,7 @@ require 'pp'
|
|
6
6
|
|
7
7
|
module RSpec
|
8
8
|
module Support
|
9
|
-
# rubocop:disable ClassLength
|
9
|
+
# rubocop:disable Metrics/ClassLength
|
10
10
|
class Differ
|
11
11
|
def diff(actual, expected)
|
12
12
|
diff = ""
|
@@ -24,7 +24,7 @@ module RSpec
|
|
24
24
|
diff.to_s
|
25
25
|
end
|
26
26
|
|
27
|
-
# rubocop:disable MethodLength
|
27
|
+
# rubocop:disable Metrics/MethodLength
|
28
28
|
def diff_as_string(actual, expected)
|
29
29
|
encoding = EncodedString.pick_encoding(actual, expected)
|
30
30
|
|
@@ -52,7 +52,7 @@ module RSpec
|
|
52
52
|
rescue Encoding::CompatibilityError
|
53
53
|
handle_encoding_errors(actual, expected)
|
54
54
|
end
|
55
|
-
# rubocop:enable MethodLength
|
55
|
+
# rubocop:enable Metrics/MethodLength
|
56
56
|
|
57
57
|
def diff_as_object(actual, expected)
|
58
58
|
actual_as_string = object_to_string(actual)
|
@@ -210,6 +210,6 @@ module RSpec
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
end
|
213
|
-
# rubocop:enable ClassLength
|
213
|
+
# rubocop:enable Metrics/ClassLength
|
214
214
|
end
|
215
215
|
end
|
@@ -60,7 +60,7 @@ module RSpec
|
|
60
60
|
# vs "\x80".encode('UTF-8','ASCII-8BIT', undef: :replace, replace: '<undef>')
|
61
61
|
# # => '<undef>'
|
62
62
|
# Encoding::CompatibilityError
|
63
|
-
# when Encoding.
|
63
|
+
# when Encoding.compatible?(str1, str2) is nil
|
64
64
|
# e.g. utf_16le_emoji_string.split("\n")
|
65
65
|
# e.g. valid_unicode_string.encode(utf8_encoding) << ascii_string
|
66
66
|
# Encoding::InvalidByteSequenceError:
|
@@ -92,7 +92,7 @@ module RSpec
|
|
92
92
|
string = remove_invalid_bytes(string)
|
93
93
|
string.encode(@encoding)
|
94
94
|
rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
|
95
|
-
# Originally defined as a constant to avoid
|
95
|
+
# Originally defined as a constant to avoid unneeded allocations, this hash must
|
96
96
|
# be defined inline (without {}) to avoid warnings on Ruby 2.7
|
97
97
|
#
|
98
98
|
# In MRI 2.1 'invalid: :replace' changed to also replace an invalid byte sequence
|
@@ -108,7 +108,7 @@ module RSpec
|
|
108
108
|
#
|
109
109
|
string.encode(@encoding, :invalid => :replace, :undef => :replace, :replace => REPLACE)
|
110
110
|
rescue Encoding::ConverterNotFoundError
|
111
|
-
# Originally defined as a constant to avoid
|
111
|
+
# Originally defined as a constant to avoid unneeded allocations, this hash must
|
112
112
|
# be defined inline (without {}) to avoid warnings on Ruby 2.7
|
113
113
|
string.dup.force_encoding(@encoding).encode(:invalid => :replace, :replace => REPLACE)
|
114
114
|
end
|
@@ -8,7 +8,7 @@ module RSpec
|
|
8
8
|
# keyword args of a given method.
|
9
9
|
#
|
10
10
|
# @private
|
11
|
-
class MethodSignature # rubocop:disable ClassLength
|
11
|
+
class MethodSignature # rubocop:disable Metrics/ClassLength
|
12
12
|
attr_reader :min_non_kw_args, :max_non_kw_args, :optional_kw_args, :required_kw_args
|
13
13
|
|
14
14
|
def initialize(method)
|
@@ -285,7 +285,7 @@ module RSpec
|
|
285
285
|
@arbitrary_kw_args = @unlimited_args = false
|
286
286
|
end
|
287
287
|
|
288
|
-
def with_expectation(expectation) # rubocop:disable
|
288
|
+
def with_expectation(expectation) # rubocop:disable Metrics/MethodLength
|
289
289
|
return self unless MethodSignatureExpectation === expectation
|
290
290
|
|
291
291
|
if expectation.empty?
|
data/lib/rspec/support/mutex.rb
CHANGED
@@ -9,7 +9,7 @@ module RSpec
|
|
9
9
|
# Some methods we don't need are deleted. Anything I don't
|
10
10
|
# understand (there's quite a bit, actually) is left in.
|
11
11
|
#
|
12
|
-
# Some
|
12
|
+
# Some formatting changes are made to appease the robot overlord:
|
13
13
|
# https://travis-ci.org/rspec/rspec-core/jobs/54410874
|
14
14
|
# @private
|
15
15
|
class Mutex
|
@@ -27,17 +27,34 @@ module RSpec
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
# This is fixing a bug #501 that is specific to Ruby 3.0. The new implementation
|
31
|
+
# depends on `owned?` that was introduced in Ruby 2.0, so both should work for Ruby 2.x.
|
32
|
+
if RUBY_VERSION.to_f >= 3.0
|
33
|
+
def enter
|
34
|
+
@mutex.lock unless @mutex.owned?
|
35
|
+
@count += 1
|
36
|
+
end
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
def exit
|
39
|
+
unless @mutex.owned?
|
40
|
+
raise ThreadError, "Attempt to unlock a mutex which is locked by another thread/fiber"
|
41
|
+
end
|
42
|
+
@count -= 1
|
43
|
+
@mutex.unlock if @count == 0
|
44
|
+
end
|
45
|
+
else
|
46
|
+
def enter
|
47
|
+
@mutex.lock if @owner != Thread.current
|
48
|
+
@owner = Thread.current
|
49
|
+
@count += 1
|
50
|
+
end
|
51
|
+
|
52
|
+
def exit
|
53
|
+
@count -= 1
|
54
|
+
return unless @count == 0
|
55
|
+
@owner = nil
|
56
|
+
@mutex.unlock
|
57
|
+
end
|
41
58
|
end
|
42
59
|
end
|
43
60
|
|
@@ -116,6 +116,9 @@ module RSpec
|
|
116
116
|
ripper_requirements.push(!Ruby.jruby_version.between?('9.0.0.0.rc1', '9.2.0.0'))
|
117
117
|
end
|
118
118
|
|
119
|
+
# TruffleRuby disables ripper due to low performance
|
120
|
+
ripper_requirements.push(false) if Ruby.truffleruby?
|
121
|
+
|
119
122
|
if ripper_requirements.all?
|
120
123
|
def ripper_supported?
|
121
124
|
true
|
@@ -54,12 +54,16 @@ module RSpec
|
|
54
54
|
type == :on_kw
|
55
55
|
end
|
56
56
|
|
57
|
+
def equals_operator?
|
58
|
+
type == :on_op && string == '='
|
59
|
+
end
|
60
|
+
|
57
61
|
def opening?
|
58
62
|
opening_delimiter? || opening_keyword?
|
59
63
|
end
|
60
64
|
|
61
65
|
def closed_by?(other)
|
62
|
-
|
66
|
+
delimiter_closed_by?(other) || keyword_closed_by?(other)
|
63
67
|
end
|
64
68
|
|
65
69
|
private
|
@@ -73,13 +77,16 @@ module RSpec
|
|
73
77
|
CLOSING_KEYWORDS_BY_OPENING_KEYWORD.key?(string)
|
74
78
|
end
|
75
79
|
|
76
|
-
def
|
80
|
+
def delimiter_closed_by?(other)
|
77
81
|
other.type == CLOSING_TYPES_BY_OPENING_TYPE[type]
|
78
82
|
end
|
79
83
|
|
80
|
-
def
|
81
|
-
return false unless
|
82
|
-
other.string == CLOSING_KEYWORDS_BY_OPENING_KEYWORD[string]
|
84
|
+
def keyword_closed_by?(other)
|
85
|
+
return false unless keyword?
|
86
|
+
return true if other.string == CLOSING_KEYWORDS_BY_OPENING_KEYWORD[string]
|
87
|
+
|
88
|
+
# Ruby 3's `end`-less method definition: `def method_name = body`
|
89
|
+
string == 'def' && other.equals_operator? && location.line == other.location.line
|
83
90
|
end
|
84
91
|
end
|
85
92
|
end
|
@@ -7,7 +7,7 @@ module RSpec
|
|
7
7
|
|
8
8
|
# Useful as a way to isolate a global change to a subprocess.
|
9
9
|
|
10
|
-
def in_sub_process(prevent_warnings=true) # rubocop:disable MethodLength, Metrics/AbcSize
|
10
|
+
def in_sub_process(prevent_warnings=true) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
11
11
|
exception_reader, exception_writer = IO.pipe
|
12
12
|
result_reader, result_writer = IO.pipe
|
13
13
|
|
@@ -39,7 +39,7 @@ module RSpec
|
|
39
39
|
def write(line)
|
40
40
|
return if line =~ %r{^\S+/gems/\S+:\d+: warning:} # http://rubular.com/r/kqeUIZOfPG
|
41
41
|
|
42
|
-
# Ruby 2.7.0 warnings from keyword
|
42
|
+
# Ruby 2.7.0 warnings from keyword arguments span multiple lines, extend check above
|
43
43
|
# to look for the next line.
|
44
44
|
return if @last_line =~ %r{^\S+/gems/\S+:\d+: warning:} &&
|
45
45
|
line =~ %r{warning: The called method .* is defined here}
|
@@ -9,7 +9,7 @@ module RSpec
|
|
9
9
|
module_function
|
10
10
|
|
11
11
|
if RSpec::Support::RubyFeatures.kw_args_supported?
|
12
|
-
# Remove this in RSpec 4 in favour of
|
12
|
+
# Remove this in RSpec 4 in favour of explicitly passed in kwargs where
|
13
13
|
# this is used. Works around a warning in Ruby 2.7
|
14
14
|
|
15
15
|
def class_exec(klass, *args, &block)
|
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.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
- Sam Phippen
|
11
11
|
- Xaviery Shay
|
12
12
|
- Bradley Schaefer
|
13
|
-
autorequire:
|
13
|
+
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain:
|
16
16
|
- |
|
@@ -48,7 +48,7 @@ cert_chain:
|
|
48
48
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
49
49
|
F3MdtaDehhjC
|
50
50
|
-----END CERTIFICATE-----
|
51
|
-
date:
|
51
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
52
52
|
dependencies:
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rake
|
@@ -125,11 +125,11 @@ licenses:
|
|
125
125
|
- MIT
|
126
126
|
metadata:
|
127
127
|
bug_tracker_uri: https://github.com/rspec/rspec-support/issues
|
128
|
-
changelog_uri: https://github.com/rspec/rspec-support/blob/v3.
|
128
|
+
changelog_uri: https://github.com/rspec/rspec-support/blob/v3.11.1/Changelog.md
|
129
129
|
documentation_uri: https://rspec.info/documentation/
|
130
130
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
131
131
|
source_code_uri: https://github.com/rspec/rspec-support
|
132
|
-
post_install_message:
|
132
|
+
post_install_message:
|
133
133
|
rdoc_options:
|
134
134
|
- "--charset=UTF-8"
|
135
135
|
require_paths:
|
@@ -145,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
-
signing_key:
|
148
|
+
rubygems_version: 3.1.6
|
149
|
+
signing_key:
|
150
150
|
specification_version: 4
|
151
|
-
summary: rspec-support-3.
|
151
|
+
summary: rspec-support-3.11.1
|
152
152
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|