diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-23 15:18:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-23 15:18:13 +0900 |
| commit | 2a5545cc25ebc280cfd5507d61339fca45c0291b (patch) | |
| tree | b28cea4596708d9dc7f29b8734fb5cce3f7f350b | |
| parent | 6999e45742329cd274b8d13231aaff39c578119b (diff) | |
| download | mruby-2a5545cc25ebc280cfd5507d61339fca45c0291b.tar.gz mruby-2a5545cc25ebc280cfd5507d61339fca45c0291b.zip | |
Update `Kernel#method_missing` tests for new `NoMethodError` message.
Also removed tests that depends on implementation details of the default
`method_missing` behavior.
| -rw-r--r-- | test/t/kernel.rb | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb index 4bd102392..eaae78e47 100644 --- a/test/t/kernel.rb +++ b/test/t/kernel.rb @@ -366,48 +366,14 @@ assert('Kernel#method_missing', '15.3.1.3.30') do begin no_super_test.no_super_method_named_this rescue NoMethodError => e - assert_equal "undefined method 'no_super_method_named_this' for #{no_super_test}", e.message + assert_equal "undefined method 'no_super_method_named_this'", e.message end a = String.new begin a.no_method_named_this rescue NoMethodError => e - assert_equal "undefined method 'no_method_named_this' for \"\"", e.message - end - - class ShortInspectClass - def inspect - 'An inspect string' - end - end - b = ShortInspectClass.new - begin - b.no_method_named_this - rescue NoMethodError => e - assert_equal "undefined method 'no_method_named_this' for An inspect string", e.message - end - - class LongInspectClass - def inspect - "A" * 70 - end - end - c = LongInspectClass.new - begin - c.no_method_named_this - rescue NoMethodError => e - assert_equal "undefined method 'no_method_named_this' for #{c}", e.message - end - - class NoInspectClass - undef inspect - end - d = NoInspectClass.new - begin - d.no_method_named_this - rescue NoMethodError => e - assert_equal "undefined method 'no_method_named_this' for #{d}", e.message + assert_equal "undefined method 'no_method_named_this'", e.message end end |
