Skip to content

Commit 5d9201b

Browse files
committed
Fix minitest assertion for Ruby >= 3.4
Context: Failure: ActiveModel::Serializer::ReflectionTest#test_no_href_in_vanilla_reflection [/.rvm/gems/ruby-3.4.7/gems/minitest-5.10.3/lib/minitest/assertions.rb:139]: Expected /undefined method `href'/ to match # encoding: US-ASCII "undefined method 'href' for an instance of ActiveModel::Serializer::HasOneReflection".
1 parent eec4d8e commit 5d9201b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/serializers/reflection_test.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ def test_no_href_in_vanilla_reflection
383383
exception = assert_raise(NoMethodError) do
384384
reflection.instance_eval(&link)
385385
end
386-
assert_match(/undefined method `href'/, exception.message)
386+
387+
expected = RUBY_VERSION >= '3.4.0' ? /undefined method 'href'/ : /undefined method `href'/
388+
389+
assert_match(expected, exception.message)
387390
end
388391

389392
# rubocop:disable Metrics/AbcSize

0 commit comments

Comments
 (0)