Skip to content

Commit

Permalink
Merge pull request #3018 from rspec/switch-jruby-to-legacy
Browse files Browse the repository at this point in the history
Switch JRuby 9.1.17.0 to Docker
  • Loading branch information
JonRowe committed Mar 14, 2023
1 parent f47655d commit 0590699
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
9 changes: 8 additions & 1 deletion spec/integration/bisect_runners_spec.rb
Expand Up @@ -82,11 +82,18 @@ def with_runner(&block)
end
"

rspec_description =
if RUBY_VERSION.to_f > 3.2
"module RSpec"
else
"RSpec:Module"
end

with_runner do |runner|
expect {
runner.original_results
}.to raise_error(Bisect::BisectFailedError, a_string_including(
"undefined method `escribe' for RSpec:Module",
"undefined method `escribe' for #{rspec_description}",
'stdout in a_spec',
'stderr in a_spec'
))
Expand Down
6 changes: 6 additions & 0 deletions spec/integration/bisect_spec.rb
Expand Up @@ -15,6 +15,12 @@ def bisect(cli_args, expected_status=nil)
normalize_durations(formatter_output.string)
end

before do
if RSpec::Support::Ruby.jruby? && RSpec::Support::Ruby.jruby_version == '9.1.17.0'
skip "These specs are currently broken on JRuby 9.1.17.0"
end
end

context "when a load-time problem occurs while running the suite" do
it 'surfaces the stdout and stderr output to the user' do
output = bisect(%w[spec/rspec/core/resources/fail_on_load_spec.rb_], 1)
Expand Down
12 changes: 10 additions & 2 deletions spec/integration/spec_file_load_errors_spec.rb
Expand Up @@ -147,20 +147,28 @@
run_command "1_spec.rb 2_spec.rb 3_spec.rb"
expect(last_cmd_exit_status).to eq(error_exit_code)
output = normalize_durations(last_cmd_stdout)

object_suffix =
if RUBY_VERSION.to_f > 3.2
""
else
":Object"
end

expect(output).to eq unindent(<<-EOS)
An error occurred while loading ./1_spec.rb.
Failure/Error: boom
NameError:
undefined local variable or method `boom' for main:Object
undefined local variable or method `boom' for main#{object_suffix}
# ./1_spec.rb:1#{spec_line_suffix}
An error occurred while loading ./3_spec.rb.
Failure/Error: boom
NameError:
undefined local variable or method `boom' for main:Object
undefined local variable or method `boom' for main#{object_suffix}
# ./3_spec.rb:1#{spec_line_suffix}
Expand Down
4 changes: 4 additions & 0 deletions spec/rspec/core_spec.rb
Expand Up @@ -79,6 +79,10 @@
before(:example) do
skip "Not reliably working on #{RUBY_DESCRIPTION}"
end
elsif RSpec::Support::Ruby.jruby? && JRUBY_VERSION =~ /9\.1\.17\.0/
before(:example, :description => /spec files/) do
pending "JRuby 9.1.17.0 generates unrelated warnings"
end
end
end

Expand Down

0 comments on commit 0590699

Please sign in to comment.