From ae53949e3d84c49fe9fdad54da0c21631d4771f3 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 22 Feb 2023 12:00:48 +0100 Subject: [PATCH] Merge pull request #47457 from zzak/ruby-3.3/feature/18285 Fix ruby:master re: ruby/feature/18285 --- actionview/test/template/render_test.rb | 2 +- activesupport/test/core_ext/time_with_zone_test.rb | 2 +- railties/test/railties/railtie_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index f2dfb6070d6e5..236f29a6ede73 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -327,7 +327,7 @@ def test_render_sub_template_with_errors def test_undefined_method_error_references_named_class e = assert_raises(ActionView::Template::Error) { @view.render(inline: "<%= undefined %>") } - assert_match(/`undefined' for #/, e.message) + assert_match(/undefined local variable or method `undefined'/, e.message) end def test_render_renderable_object diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb index a14a89a2d7369..820181c08e52c 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -1097,7 +1097,7 @@ def test_no_method_error_has_proper_context e = assert_raises(NoMethodError) { @twz.this_method_does_not_exist } - assert_match "undefined method `this_method_does_not_exist' for Fri, 31 Dec 1999 19:00:00.000000000 EST -05:00:ActiveSupport::TimeWithZone", e.message + assert_match(/undefined method `this_method_does_not_exist' for.*ActiveSupport::TimeWithZone/, e.message) assert_no_match "rescue", e.backtrace.first end end diff --git a/railties/test/railties/railtie_test.rb b/railties/test/railties/railtie_test.rb index a8f104035b371..62ebc319aa393 100644 --- a/railties/test/railties/railtie_test.rb +++ b/railties/test/railties/railtie_test.rb @@ -243,7 +243,7 @@ class Foo < Rails::Railtie Foo.instance.abc end - assert_equal("undefined method `abc' for #", error.original_message) + assert_match(/undefined method `abc' for.*RailtiesTest::RailtieTest::Foo/, error.original_message) end end end