Skip to content

Commit

Permalink
Maybe this will fix the jRuby error
Browse files Browse the repository at this point in the history
  • Loading branch information
shanecav84 committed Mar 11, 2022
1 parent ec1b222 commit 5d9d3b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snippets/include_activesupport_testing_tagged_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ class TestError < StandardError; end
it 'raises the explicitly thrown error' do
allow_any_instance_of(TestJob).to receive(:perform).and_raise(TestError)

test_error = TestError.new('foo')
# Rails 6.1+ wraps unexpected errors in tests
expected_error = if Rails::VERSION::STRING.to_f >= 6.1
Minitest::UnexpectedError.new(TestError)
Minitest::UnexpectedError.new(test_error)
else
TestError
test_error
end

expect { perform_enqueued_jobs { TestJob.perform_later } }
Expand Down

0 comments on commit 5d9d3b0

Please sign in to comment.