rspec-support 3.10.0 → 3.11.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7087e0924dbb4a0a167857659dd1b85f73952ede008d348c9f1371da653835da
4
- data.tar.gz: 236c1ff98b46e3d4b208aae30a4c26bb701d911896746ac0d3573caaefbdaea1
3
+ metadata.gz: 15b095a31f89b4f715f85a98def34e8d8e401552aa3cbdd8e41e97229acaa7a3
4
+ data.tar.gz: 7e038fa362d523cc2b271357fd777624479e4952327d286261d3b5d6e503f664
5
5
  SHA512:
6
- metadata.gz: 93bac1be9a9ba640100c1141213da23784197fccbf4bce0e0488faf073d83d06a8787638cb4468790bd8e9c3fe901ed05cac944155084dc6c8b434da13be7ec4
7
- data.tar.gz: b23a93adcb954245564b219519756b274718ecf81b07deee7a9a1a350bfe02afbbdf46f871c9e164ec9247301523556998b616e02b2bccc9c6b72eb93feefa4a
6
+ metadata.gz: 631144fe2de1984bb09db168acbee96186e9709838f4a3c963d083007da80a529c45db2e80890548f78a07e8c190e374b1a40f669d0ca24c0d15030c306698ec
7
+ data.tar.gz: e9ecd3254c12547501b1bf973e56bc818189ffe979394603cad8fbbaf6b653b5ac51819ba50fb0df555e473f968f55b7359f8f77d38b36ee0b6ee0f2a96c8b00
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,8 +1,44 @@
1
+ ### Development
2
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.0...3-11-maintenance)
3
+
4
+ ### 3.11.0 / 2022-02-09
5
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.3...v3.11.0)
6
+
7
+ No changes. Released to support other RSpec releases.
8
+
9
+ ### 3.10.3 / 2021-11-03
10
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.2...v3.10.3)
11
+
12
+ Bug Fixes:
13
+
14
+ * Use `Mutex#owned?` to allow `RSpec::Support::ReentrantMutex` to work in
15
+ nested Fibers on Ruby 3.0 and later. (Benoit Daloze, #503, #504)
16
+ * Support `end`-less methods in `RSpec::Support::Source::Token`
17
+ so that RSpec won't hang when an `end`-less method raises an error. (Yuji Nakayama, #505)
18
+
19
+ ### 3.10.2 / 2021-01-28
20
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.1...v3.10.2)
21
+
22
+ Bug Fixes:
23
+
24
+ * Fix issue with `RSpec::Support.define_optimized_require_for_rspec` on JRuby
25
+ 9.1.17.0 (Jon Rowe, #492)
26
+
27
+ ### 3.10.1 / 2020-12-27
28
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.0...v3.10.1)
29
+
30
+ Bug Fixes:
31
+
32
+ * Fix deprecation expectations to fail correctly when
33
+ asserting on messages. (Phil Pirozhkov, #453)
34
+
1
35
  ### 3.10.0 / 2020-10-30
36
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.4...v3.10.0)
2
37
 
3
38
  No changes. Released to support other RSpec releases.
4
39
 
5
40
  ### 3.9.4 / 2020-10-23
41
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.3...v3.9.4)
6
42
 
7
43
  Bug Fixes:
8
44
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RSpec::Support
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
@@ -27,17 +27,34 @@ module RSpec
27
27
 
28
28
  private
29
29
 
30
- def enter
31
- @mutex.lock if @owner != Thread.current
32
- @owner = Thread.current
33
- @count += 1
34
- end
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
- def exit
37
- @count -= 1
38
- return unless @count == 0
39
- @owner = nil
40
- @mutex.unlock
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
 
@@ -60,7 +60,7 @@ module RSpec
60
60
  module RubyFeatures
61
61
  module_function
62
62
 
63
- if Ruby.jruby?
63
+ if Ruby.jruby? && RUBY_VERSION.to_f < 1.9
64
64
  # On JRuby 1.7 `--1.8` mode, `Process.respond_to?(:fork)` returns true,
65
65
  # but when you try to fork, it raises an error:
66
66
  # NotImplementedError: fork is not available on this platform
@@ -111,7 +111,8 @@ module RSpec
111
111
  ripper_requirements.push(Ruby.jruby_version >= '1.7.5')
112
112
  # Ripper on JRuby 9.0.0.0.rc1 - 9.1.8.0 reports wrong line number
113
113
  # or cannot parse source including `:if`.
114
- # Ripper on JRuby 9.x.x.x < 9.2.1.0 can't handle keyword arguments.
114
+ # Ripper on JRuby 9.x.x.x < 9.1.17.0 can't handle keyword arguments
115
+ # Neither can JRuby 9.2, e.g. < 9.2.1.0
115
116
  ripper_requirements.push(!Ruby.jruby_version.between?('9.0.0.0.rc1', '9.2.0.0'))
116
117
  end
117
118
 
@@ -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
- closed_by_delimiter?(other) || closed_by_keyword?(other)
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 closed_by_delimiter?(other)
80
+ def delimiter_closed_by?(other)
77
81
  other.type == CLOSING_TYPES_BY_OPENING_TYPE[type]
78
82
  end
79
83
 
80
- def closed_by_keyword?(other)
81
- return false unless other.keyword?
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
@@ -1,35 +1,22 @@
1
1
  module RSpecHelpers
2
- def expect_no_deprecation
3
- expect(RSpec.configuration.reporter).not_to receive(:deprecation)
4
- end
5
-
6
2
  def expect_deprecation_with_call_site(file, line, snippet=//)
7
- expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
8
- expect(options[:call_site]).to include([file, line].join(':'))
9
- expect(options[:deprecated]).to match(snippet)
10
- end
3
+ expect(RSpec.configuration.reporter).to receive(:deprecation).
4
+ with(include(:deprecated => match(snippet), :call_site => include([file, line].join(':'))))
11
5
  end
12
6
 
13
7
  def expect_deprecation_without_call_site(snippet=//)
14
- expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
15
- expect(options[:call_site]).to eq nil
16
- expect(options[:deprecated]).to match(snippet)
17
- end
8
+ expect(RSpec.configuration.reporter).to receive(:deprecation).
9
+ with(include(:deprecated => match(snippet), :call_site => eq(nil)))
18
10
  end
19
11
 
20
12
  def expect_warn_deprecation_with_call_site(file, line, snippet=//)
21
- expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
22
- message = options[:message]
23
- expect(message).to match(snippet)
24
- expect(message).to include([file, line].join(':'))
25
- end
13
+ expect(RSpec.configuration.reporter).to receive(:deprecation).
14
+ with(include(:message => match(snippet), :call_site => include([file, line].join(':'))))
26
15
  end
27
16
 
28
17
  def expect_warn_deprecation(snippet=//)
29
- expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
30
- message = options[:message]
31
- expect(message).to match(snippet)
32
- end
18
+ expect(RSpec.configuration.reporter).to receive(:deprecation).
19
+ with(include(:message => match(snippet)))
33
20
  end
34
21
 
35
22
  def allow_deprecation
@@ -39,19 +26,16 @@ module RSpecHelpers
39
26
  def expect_no_deprecations
40
27
  expect(RSpec.configuration.reporter).not_to receive(:deprecation)
41
28
  end
29
+ alias expect_no_deprecation expect_no_deprecations
42
30
 
43
31
  def expect_warning_without_call_site(expected=//)
44
- expect(::Kernel).to receive(:warn) do |message|
45
- expect(message).to match expected
46
- expect(message).to_not match(/Called from/)
47
- end
32
+ expect(::Kernel).to receive(:warn).
33
+ with(match(expected).and(satisfy { |message| !(/Called from/ =~ message) }))
48
34
  end
49
35
 
50
36
  def expect_warning_with_call_site(file, line, expected=//)
51
- expect(::Kernel).to receive(:warn) do |message|
52
- expect(message).to match expected
53
- expect(message).to match(/Called from #{file}:#{line}/)
54
- end
37
+ expect(::Kernel).to receive(:warn).
38
+ with(match(expected).and(match(/Called from #{file}:#{line}/)))
55
39
  end
56
40
 
57
41
  def expect_no_warnings
@@ -59,7 +59,7 @@ module RSpec
59
59
  %r{bundler/source/rubygems},
60
60
  # Ignore bundler + rubygems warning.
61
61
  %r{site_ruby/\d\.\d\.\d/rubygems},
62
- %r{jruby-\d\.\d\.\d\.\d/lib/ruby/stdlib/rubygems},
62
+ %r{jruby-\d\.\d\.\d+\.\d/lib/ruby/stdlib/rubygems},
63
63
  # This is required for windows for some reason
64
64
  %r{lib/bundler/rubygems},
65
65
  # This is a JRuby file that generates warnings on 9.0.3.0
@@ -70,8 +70,13 @@ module RSpec
70
70
  %r{ffi-1\.13\.\d+-java},
71
71
  %r{uninitialized constant FFI},
72
72
  # These are related to the above, there is a warning about io from FFI
73
- %r{jruby-\d\.\d\.\d\.\d/lib/ruby/stdlib/io},
73
+ %r{jruby-\d\.\d\.\d+\.\d/lib/ruby/stdlib/io},
74
74
  %r{io/console on JRuby shells out to stty for most operations},
75
+ # This is a JRuby 9.1.17.0 error on Github Actions
76
+ %r{io/console not supported; tty will not be manipulated},
77
+ # This is a JRuby 9.2.1.x error
78
+ %r{jruby/kernel/gem_prelude},
79
+ %r{lib/jruby\.jar!/jruby/preludes},
75
80
  ]
76
81
 
77
82
  def strip_known_warnings(input)
@@ -87,7 +92,7 @@ module RSpec
87
92
  if Ruby.jruby?
88
93
  def filter(output)
89
94
  output.each_line.reject do |line|
90
- line.include?("lib/ruby/shared/rubygems/defaults/jruby")
95
+ line.include?("lib/ruby/shared/rubygems")
91
96
  end.join($/)
92
97
  end
93
98
  else
@@ -36,9 +36,9 @@ RSpec.configure do |c|
36
36
 
37
37
  c.example_status_persistence_file_path = "./spec/examples.txt"
38
38
 
39
- c.define_derived_metadata :failing_on_appveyor do |meta|
40
- meta[:pending] ||= "This spec fails on AppVeyor and needs someone to fix it."
41
- end if ENV['APPVEYOR']
39
+ c.define_derived_metadata :failing_on_windows_ci do |meta|
40
+ meta[:pending] ||= "This spec fails on Windows CI and needs someone to fix it."
41
+ end if RSpec::Support::OS.windows? && ENV['CI']
42
42
  end
43
43
 
44
44
  module RSpec
@@ -65,8 +65,8 @@ module RSpec
65
65
 
66
66
  def self.start_simplecov(&block)
67
67
  SimpleCov.start do
68
- add_filter "./bundle/"
69
- add_filter "./tmp/"
68
+ add_filter "bundle/"
69
+ add_filter "tmp/"
70
70
  add_filter do |source_file|
71
71
  # Filter out `spec` directory except when it is under `lib`
72
72
  # (as is the case in rspec-support)
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Support
3
3
  module Version
4
- STRING = '3.10.0'
4
+ STRING = '3.11.0'
5
5
  end
6
6
  end
7
7
  end
data/lib/rspec/support.rb CHANGED
@@ -14,7 +14,12 @@ module RSpec
14
14
  def self.define_optimized_require_for_rspec(lib, &require_relative)
15
15
  name = "require_rspec_#{lib}"
16
16
 
17
- if Kernel.respond_to?(:require_relative)
17
+ if RUBY_PLATFORM == 'java' && !Kernel.respond_to?(:require)
18
+ # JRuby 9.1.17.0 has developed a regression for require
19
+ (class << self; self; end).__send__(:define_method, name) do |f|
20
+ Kernel.send(:require, "rspec/#{lib}/#{f}")
21
+ end
22
+ elsif Kernel.respond_to?(:require_relative)
18
23
  (class << self; self; end).__send__(:define_method, name) do |f|
19
24
  require_relative.call("#{lib}/#{f}")
20
25
  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.10.0
4
+ version: 3.11.0
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: 2020-10-30 00:00:00.000000000 Z
51
+ date: 2022-02-09 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.10.0/Changelog.md
128
+ changelog_uri: https://github.com/rspec/rspec-support/blob/v3.11.0/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.1.3
148
+ rubygems_version: 3.3.3
149
149
  signing_key:
150
150
  specification_version: 4
151
- summary: rspec-support-3.10.0
151
+ summary: rspec-support-3.11.0
152
152
  test_files: []
metadata.gz.sig CHANGED
Binary file