diff --git a/spec/integration/bisect_runners_spec.rb b/spec/integration/bisect_runners_spec.rb index 46c04ae1e9..591b3290dd 100644 --- a/spec/integration/bisect_runners_spec.rb +++ b/spec/integration/bisect_runners_spec.rb @@ -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' )) diff --git a/spec/integration/bisect_spec.rb b/spec/integration/bisect_spec.rb index 74fbf57995..9f79a47b2a 100644 --- a/spec/integration/bisect_spec.rb +++ b/spec/integration/bisect_spec.rb @@ -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) diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index 7daa3bb5e9..e4ba671c59 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -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} diff --git a/spec/rspec/core_spec.rb b/spec/rspec/core_spec.rb index 8dfeacf09c..3ab8848aaa 100644 --- a/spec/rspec/core_spec.rb +++ b/spec/rspec/core_spec.rb @@ -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