summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2023-02-19 16:10:30 +0900
committergit <svn-admin@ruby-lang.org>2023-02-19 07:10:47 +0000
commit4dc2cb3c1a6d1ee2456cdb0c78d6189b5686f013 (patch)
treec5e9948f4d36ffa76b237cb2e25aeef9b757b3a2
parentcbac0fa4cb43c8ec35683e3ae848d5fb8143c757 (diff)
downloadruby-4dc2cb3c1a6d1ee2456cdb0c78d6189b5686f013.tar.gz
[ruby/did_you_mean] Support the new message format of NameError in
Ruby 3.3 (https://github.com/ruby/did_you_mean/pull/184) This change accepts the following change of the message of NameError in a test. https://bugs.ruby-lang.org/issues/18285#note-37 ``` old: undefined method `sizee' for #<File:...> new: undefined method `sizee' for an instance of File ```
-rw-r--r--test/did_you_mean/core_ext/test_name_error_extension.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/did_you_mean/core_ext/test_name_error_extension.rb b/test/did_you_mean/core_ext/test_name_error_extension.rb
index 1fdbd4510f..c58b78455f 100644
--- a/test/did_you_mean/core_ext/test_name_error_extension.rb
+++ b/test/did_you_mean/core_ext/test_name_error_extension.rb
@@ -49,7 +49,7 @@ class NameErrorExtensionTest < Test::Unit::TestCase
get_message(error)
- assert_equal "undefined method `sizee' for #<File:test_name_error_extension.rb (closed)>",
- Marshal.load(Marshal.dump(error)).original_message
+ assert_match(/^undefined method `sizee' for /,
+ Marshal.load(Marshal.dump(error)).original_message)
end
end