rspec-support 3.11.0 → 3.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/Changelog.md +50 -3
  4. data/lib/rspec/support/caller_filter.rb +4 -2
  5. data/lib/rspec/support/comparable_version.rb +3 -1
  6. data/lib/rspec/support/differ.rb +6 -4
  7. data/lib/rspec/support/directory_maker.rb +2 -0
  8. data/lib/rspec/support/encoded_string.rb +5 -3
  9. data/lib/rspec/support/fuzzy_matcher.rb +2 -0
  10. data/lib/rspec/support/hunk_generator.rb +2 -0
  11. data/lib/rspec/support/matcher_definition.rb +2 -0
  12. data/lib/rspec/support/method_signature_verifier.rb +9 -5
  13. data/lib/rspec/support/mutex.rb +3 -1
  14. data/lib/rspec/support/object_formatter.rb +2 -0
  15. data/lib/rspec/support/recursive_const_methods.rb +2 -0
  16. data/lib/rspec/support/reentrant_mutex.rb +3 -1
  17. data/lib/rspec/support/ruby_features.rb +30 -0
  18. data/lib/rspec/support/source/location.rb +2 -0
  19. data/lib/rspec/support/source/node.rb +2 -0
  20. data/lib/rspec/support/source/token.rb +2 -0
  21. data/lib/rspec/support/source.rb +2 -0
  22. data/lib/rspec/support/spec/deprecation_helpers.rb +2 -0
  23. data/lib/rspec/support/spec/diff_helpers.rb +2 -0
  24. data/lib/rspec/support/spec/formatting_support.rb +2 -0
  25. data/lib/rspec/support/spec/in_sub_process.rb +7 -1
  26. data/lib/rspec/support/spec/library_wide_checks.rb +2 -0
  27. data/lib/rspec/support/spec/shell_out.rb +5 -0
  28. data/lib/rspec/support/spec/stderr_splitter.rb +3 -1
  29. data/lib/rspec/support/spec/string_matcher.rb +2 -0
  30. data/lib/rspec/support/spec/with_isolated_directory.rb +2 -0
  31. data/lib/rspec/support/spec/with_isolated_stderr.rb +2 -0
  32. data/lib/rspec/support/spec.rb +2 -0
  33. data/lib/rspec/support/version.rb +3 -1
  34. data/lib/rspec/support/warnings.rb +2 -0
  35. data/lib/rspec/support/with_keywords_when_needed.rb +3 -1
  36. data/lib/rspec/support.rb +10 -2
  37. data.tar.gz.sig +0 -0
  38. metadata +5 -5
  39. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15b095a31f89b4f715f85a98def34e8d8e401552aa3cbdd8e41e97229acaa7a3
4
- data.tar.gz: 7e038fa362d523cc2b271357fd777624479e4952327d286261d3b5d6e503f664
3
+ metadata.gz: 92bef00902f2274e73ead3711ea3c341a34b07eb11cdf647a8d737e1d0c11382
4
+ data.tar.gz: 90317d4ebccad5e6da2abb4e2af56a1dbb217bd9961d3dc68ea80ff824f8117e
5
5
  SHA512:
6
- metadata.gz: 631144fe2de1984bb09db168acbee96186e9709838f4a3c963d083007da80a529c45db2e80890548f78a07e8c190e374b1a40f669d0ca24c0d15030c306698ec
7
- data.tar.gz: e9ecd3254c12547501b1bf973e56bc818189ffe979394603cad8fbbaf6b653b5ac51819ba50fb0df555e473f968f55b7359f8f77d38b36ee0b6ee0f2a96c8b00
6
+ metadata.gz: 025c00e2292a341c12cc2001f83a174749afa81802cc9df491563e9743ebcb3020c2d7c3743ddf5da43c127c7c5803e98d1640ebacd8ac6b5f4ccd51aa2b13e4
7
+ data.tar.gz: '0209a2909369b4da3fa8164bf47249455f69607019a7813fb598be8987dec613c3f3707484f767222b91b5b586a0eb05f63c783287284a314531736fc293264f'
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,5 +1,52 @@
1
1
  ### Development
2
- [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.0...3-11-maintenance)
2
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.13.1...main)
3
+
4
+ ### 3.13.1 / 2024-02-23
5
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.13.0...v3.13.1)
6
+
7
+ Bug Fixes:
8
+
9
+ * Exclude ruby internal require warnings from `RSpec::Support::CallerFilter#first_non_rspec_line`.
10
+ (Jon Rowe, #593)
11
+
12
+ ### 3.13.0 / 2024-02-04
13
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.12.2...v3.13.0)
14
+
15
+ Enchancements
16
+
17
+ * Add `RubyFeatures#supports_syntax_suggest?`. (Jon Rowe, #571)
18
+
19
+ ### 3.12.2 / 2024-02-04
20
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.12.1...v3.12.2)
21
+
22
+ Bug Fixes:
23
+
24
+ * Properly surface errors from `in_sub_process`. (Jon Rowe, #575)
25
+ * Add magic comment for freezing string literals. (Josh Nichols, #586)
26
+ * Allow string keys for keyword arguments during verification of method
27
+ signatures, (but only on Ruby 3+). (@malcolmohare, #591)
28
+
29
+ ### 3.12.1 / 2023-06-26
30
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.12.0...v3.12.1)
31
+
32
+ Bug Fixes:
33
+
34
+ * Fix `RSpec::Support.thread_local_data` to be Thread local but not Fiber local.
35
+ (Jon Rowe, #581)
36
+
37
+ ### 3.12.0 / 2022-10-26
38
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.1...v3.12.0)
39
+ Enhancements:
40
+
41
+ * Add `RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash?`
42
+ (Jean byroot Boussier, #535)
43
+
44
+ ### 3.11.1 / 2022-09-12
45
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.0...v3.11.1)
46
+
47
+ Bug Fixes:
48
+
49
+ * Fix ripper detection on TruffleRuby. (Brandon Fish, #541)
3
50
 
4
51
  ### 3.11.0 / 2022-02-09
5
52
  [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.3...v3.11.0)
@@ -104,7 +151,7 @@ Bug Fixes:
104
151
  Bug Fixes:
105
152
 
106
153
  * Ensure that inspecting a `SimpleDelegator` based object works regardless of
107
- visibilty of the `__getobj__` method. (Jon Rowe, #369)
154
+ visibility of the `__getobj__` method. (Jon Rowe, #369)
108
155
 
109
156
  ### 3.8.0 / 2018-08-04
110
157
  [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.7.1...v3.8.0)
@@ -212,7 +259,7 @@ Changes:
212
259
 
213
260
  Enhancements:
214
261
 
215
- * Improve formatting of `Delegator` based objects (e.g. `SimpleDelgator`) in
262
+ * Improve formatting of `Delegator` based objects (e.g. `SimpleDelegator`) in
216
263
  failure messages and diffs. (Andrew Horner, #215)
217
264
  * Add `ComparableVersion`. (Yuji Nakayama, #245)
218
265
  * Add `Ripper` support detection. (Yuji Nakayama, #245)
@@ -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 skippped the first non-rspec line, then this method would return the
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) # rubocop:disable Metrics/AbcSize
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_support 'encoded_string'
2
4
  RSpec::Support.require_rspec_support 'hunk_generator'
3
5
  RSpec::Support.require_rspec_support "object_formatter"
@@ -6,7 +8,7 @@ require 'pp'
6
8
 
7
9
  module RSpec
8
10
  module Support
9
- # rubocop:disable ClassLength
11
+ # rubocop:disable Metrics/ClassLength
10
12
  class Differ
11
13
  def diff(actual, expected)
12
14
  diff = ""
@@ -24,7 +26,7 @@ module RSpec
24
26
  diff.to_s
25
27
  end
26
28
 
27
- # rubocop:disable MethodLength
29
+ # rubocop:disable Metrics/MethodLength
28
30
  def diff_as_string(actual, expected)
29
31
  encoding = EncodedString.pick_encoding(actual, expected)
30
32
 
@@ -52,7 +54,7 @@ module RSpec
52
54
  rescue Encoding::CompatibilityError
53
55
  handle_encoding_errors(actual, expected)
54
56
  end
55
- # rubocop:enable MethodLength
57
+ # rubocop:enable Metrics/MethodLength
56
58
 
57
59
  def diff_as_object(actual, expected)
58
60
  actual_as_string = object_to_string(actual)
@@ -210,6 +212,6 @@ module RSpec
210
212
  end
211
213
  end
212
214
  end
213
- # rubocop:enable ClassLength
215
+ # rubocop:enable Metrics/ClassLength
214
216
  end
215
217
  end
@@ -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
@@ -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.compatibile?(str1, str2) is nil
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 uneeded allocations, this hash must
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 uneeded allocations, this hash must
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
  module RSpec
2
4
  module Support
3
5
  # Provides a means to fuzzy-match between two arbitrary objects.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'diff/lcs'
2
4
  require 'diff/lcs/hunk'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  # @private
@@ -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)
@@ -82,7 +84,7 @@ module RSpec
82
84
  def has_kw_args_in?(args)
83
85
  Hash === args.last &&
84
86
  could_contain_kw_args?(args) &&
85
- (args.last.empty? || args.last.keys.any? { |x| x.is_a?(Symbol) })
87
+ (RubyFeatures.kw_arg_separation? || args.last.empty? || args.last.keys.any? { |x| x.is_a?(Symbol) })
86
88
  end
87
89
 
88
90
  # Without considering what the last arg is, could it
@@ -285,7 +287,7 @@ module RSpec
285
287
  @arbitrary_kw_args = @unlimited_args = false
286
288
  end
287
289
 
288
- def with_expectation(expectation) # rubocop:disable MethodLength, Metrics/PerceivedComplexity
290
+ def with_expectation(expectation) # rubocop:disable Metrics/MethodLength
289
291
  return self unless MethodSignatureExpectation === expectation
290
292
 
291
293
  if expectation.empty?
@@ -361,7 +363,7 @@ module RSpec
361
363
  end
362
364
 
363
365
  def split_args(*args)
364
- kw_args = if @signature.has_kw_args_in?(args)
366
+ kw_args = if @signature.has_kw_args_in?(args) && !RubyFeatures.kw_arg_separation?
365
367
  last = args.pop
366
368
  non_kw_args = last.reject { |k, _| k.is_a?(Symbol) }
367
369
  if non_kw_args.empty?
@@ -370,6 +372,8 @@ module RSpec
370
372
  args << non_kw_args
371
373
  last.select { |k, _| k.is_a?(Symbol) }.keys
372
374
  end
375
+ elsif @signature.has_kw_args_in?(args) && RubyFeatures.kw_arg_separation?
376
+ args.pop.keys
373
377
  else
374
378
  []
375
379
  end
@@ -378,7 +382,7 @@ module RSpec
378
382
  end
379
383
  end
380
384
 
381
- # Figures out wether a given method can accept various arguments.
385
+ # Figures out whether a given method can accept various arguments.
382
386
  # Surprisingly non-trivial.
383
387
  #
384
388
  # @private
@@ -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 formating changes are made to appease the robot overlord:
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  # Provides recursive constant lookup methods useful for
@@ -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 Mutexs.
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'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  class Source
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_support 'source/location'
2
4
 
3
5
  module RSpec
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_support 'source/location'
2
4
 
3
5
  module RSpec
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_support 'encoded_string'
2
4
  RSpec::Support.require_rspec_support 'ruby_features'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpecHelpers
2
4
  def expect_deprecation_with_call_site(file, line, snippet=//)
3
5
  expect(RSpec.configuration.reporter).to receive(:deprecation).
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'diff/lcs'
2
4
 
3
5
  module RSpec
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  module FormattingSupport
@@ -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 'rspec/support/spec/shell_out'
2
4
 
3
5
  module RSpec
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'open3'
2
4
  require 'rake/file_utils'
3
5
  require 'shellwords'
@@ -77,6 +79,9 @@ module RSpec
77
79
  # This is a JRuby 9.2.1.x error
78
80
  %r{jruby/kernel/gem_prelude},
79
81
  %r{lib/jruby\.jar!/jruby/preludes},
82
+ # Ignore some JRuby errors for gems
83
+ %r{jruby/\d\.\d(\.\d)?/gems/aruba},
84
+ %r{jruby/\d\.\d(\.\d)?/gems/ffi},
80
85
  ]
81
86
 
82
87
  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 argments span multiple lines, extend check above
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}
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/matchers'
2
4
  # Special matcher for comparing encoded strings so that
3
5
  # we don't run any expectation failures through the Differ,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'tmpdir'
2
4
 
3
5
  RSpec.shared_context "isolated directory" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  module WithIsolatedStdErr
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/support'
2
4
  require 'rspec/support/spec/in_sub_process'
3
5
 
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  module Version
4
- STRING = '3.11.0'
6
+ STRING = '3.13.1'
5
7
  end
6
8
  end
7
9
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/support'
2
4
  RSpec::Support.require_rspec_support "caller_filter"
3
5
 
@@ -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 explictly passed in kwargs where
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
- def self.thread_local_data
93
- Thread.current[:__rspec] ||= {}
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
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.11.0
4
+ version: 3.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -48,7 +48,7 @@ cert_chain:
48
48
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
49
49
  F3MdtaDehhjC
50
50
  -----END CERTIFICATE-----
51
- date: 2022-02-09 00:00:00.000000000 Z
51
+ date: 2024-02-23 00:00:00.000000000 Z
52
52
  dependencies:
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rake
@@ -125,7 +125,7 @@ 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.11.0/Changelog.md
128
+ changelog_uri: https://github.com/rspec/rspec-support/blob/v3.13.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
@@ -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.3.3
148
+ rubygems_version: 3.5.6
149
149
  signing_key:
150
150
  specification_version: 4
151
- summary: rspec-support-3.11.0
151
+ summary: rspec-support-3.13.1
152
152
  test_files: []
metadata.gz.sig CHANGED
Binary file