diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-19 21:51:53 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-19 22:01:59 +0900 |
| commit | e207d5af43e9d6e09679e9aee9bf00a843528e0e (patch) | |
| tree | 7f83038d199fc076b316d51654819ef6bad5fa78 /mrbgems/mruby-string-ext/test | |
| parent | c09d250ca148c0efc0167d55885bd20da87b43f7 (diff) | |
| download | mruby-e207d5af43e9d6e09679e9aee9bf00a843528e0e.tar.gz mruby-e207d5af43e9d6e09679e9aee9bf00a843528e0e.zip | |
Remove implicit conversion using `to_str` method.
We have added internal convenience method `__to_str` which
does string type check.
Diffstat (limited to 'mrbgems/mruby-string-ext/test')
| -rw-r--r-- | mrbgems/mruby-string-ext/test/string.rb | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb index 757b5c50a..024b2cd4b 100644 --- a/mrbgems/mruby-string-ext/test/string.rb +++ b/mrbgems/mruby-string-ext/test/string.rb @@ -114,12 +114,6 @@ assert('String#concat') do assert_equal "Hello World!", "Hello " << "World" << 33 assert_equal "Hello World!", "Hello ".concat("World").concat(33) - o = Object.new - def o.to_str - "to_str" - end - assert_equal "hi to_str", "hi " << o - assert_raise(TypeError) { "".concat(Object.new) } end @@ -128,11 +122,6 @@ assert('String#casecmp') do assert_equal 0, "aBcDeF".casecmp("abcdef") assert_equal(-1, "abcdef".casecmp("abcdefg")) assert_equal 0, "abcdef".casecmp("ABCDEF") - o = Object.new - def o.to_str - "ABCDEF" - end - assert_equal 0, "abcdef".casecmp(o) end assert('String#start_with?') do |
