Skip to content

Commit ec1b222

Browse files
committed
Handle specific error for Rails 6.1+
1 parent a1d351c commit ec1b222

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

snippets/include_activesupport_testing_tagged_logger.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class TestError < StandardError; end
5757
it 'raises the explicitly thrown error' do
5858
allow_any_instance_of(TestJob).to receive(:perform).and_raise(TestError)
5959

60-
# Rails 7+ wraps unexpected errors in tests
61-
expected_error = if Rails::VERSION::MAJOR >= 7
60+
# Rails 6.1+ wraps unexpected errors in tests
61+
expected_error = if Rails::VERSION::STRING.to_f >= 6.1
6262
Minitest::UnexpectedError.new(TestError)
6363
else
6464
TestError

0 commit comments

Comments
 (0)