From 67748d05967256d2d030f8c3b1ec8e1e45f5f812 Mon Sep 17 00:00:00 2001 From: zzak Date: Wed, 22 Feb 2023 19:04:25 +0900 Subject: [PATCH] Fix ruby:master re: ruby/feature/18285 ruby/ruby#6950 Co-authored-by: Jean byroot Boussier --- 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 7f8a0e2d5ca42..524065921feca 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -340,7 +340,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 5bec188891c2f..43635985d4899 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -1095,7 +1095,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