Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 1e795c8

Browse files
authored
Merge pull request #3018 from rspec/switch-jruby-to-legacy
Switch JRuby 9.1.17.0 to Docker
2 parents 870d12d + 4b0e6e4 commit 1e795c8

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

spec/integration/bisect_runners_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ def with_runner(&block)
8282
end
8383
"
8484

85+
rspec_description =
86+
if RUBY_VERSION.to_f > 3.2
87+
"module RSpec"
88+
else
89+
"RSpec:Module"
90+
end
91+
8592
with_runner do |runner|
8693
expect {
8794
runner.original_results
8895
}.to raise_error(Bisect::BisectFailedError, a_string_including(
89-
"undefined method `escribe' for RSpec:Module",
96+
"undefined method `escribe' for #{rspec_description}",
9097
'stdout in a_spec',
9198
'stderr in a_spec'
9299
))

spec/integration/bisect_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ def bisect(cli_args, expected_status=nil)
1515
normalize_durations(formatter_output.string)
1616
end
1717

18+
before do
19+
if RSpec::Support::Ruby.jruby? && RSpec::Support::Ruby.jruby_version == '9.1.17.0'
20+
skip "These specs are currently broken on JRuby 9.1.17.0"
21+
end
22+
end
23+
1824
context "when a load-time problem occurs while running the suite" do
1925
it 'surfaces the stdout and stderr output to the user' do
2026
output = bisect(%w[spec/rspec/core/resources/fail_on_load_spec.rb_], 1)

spec/integration/spec_file_load_errors_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,28 @@
147147
run_command "1_spec.rb 2_spec.rb 3_spec.rb"
148148
expect(last_cmd_exit_status).to eq(error_exit_code)
149149
output = normalize_durations(last_cmd_stdout)
150+
151+
object_suffix =
152+
if RUBY_VERSION.to_f > 3.2
153+
""
154+
else
155+
":Object"
156+
end
157+
150158
expect(output).to eq unindent(<<-EOS)
151159
152160
An error occurred while loading ./1_spec.rb.
153161
Failure/Error: boom
154162
155163
NameError:
156-
undefined local variable or method `boom' for main:Object
164+
undefined local variable or method `boom' for main#{object_suffix}
157165
# ./1_spec.rb:1#{spec_line_suffix}
158166
159167
An error occurred while loading ./3_spec.rb.
160168
Failure/Error: boom
161169
162170
NameError:
163-
undefined local variable or method `boom' for main:Object
171+
undefined local variable or method `boom' for main#{object_suffix}
164172
# ./3_spec.rb:1#{spec_line_suffix}
165173
166174

spec/rspec/core_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
before(:example) do
8080
skip "Not reliably working on #{RUBY_DESCRIPTION}"
8181
end
82+
elsif RSpec::Support::Ruby.jruby? && JRUBY_VERSION =~ /9\.1\.17\.0/
83+
before(:example, :description => /spec files/) do
84+
pending "JRuby 9.1.17.0 generates unrelated warnings"
85+
end
8286
end
8387
end
8488

0 commit comments

Comments
 (0)