summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/test/string.rb
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2013-08-23 13:42:43 +0900
committerTomoyuki Sahara <[email protected]>2013-08-23 15:06:26 +0900
commit0e8efd4a218f3d235f88054f0d9d11f8bfdcfd33 (patch)
treee93b441e955f5d835b55f8df67a591249d907297 /mrbgems/mruby-string-ext/test/string.rb
parent53ff8172e549ebd90ca11d0a4f6e6a57bbd2edf9 (diff)
downloadmruby-0e8efd4a218f3d235f88054f0d9d11f8bfdcfd33.tar.gz
mruby-0e8efd4a218f3d235f88054f0d9d11f8bfdcfd33.zip
Check type of arguments for #start_with and #end_with.
Diffstat (limited to 'mrbgems/mruby-string-ext/test/string.rb')
-rw-r--r--mrbgems/mruby-string-ext/test/string.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb
index 9eb6f6aaa..496730a0e 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -104,9 +104,11 @@ end
assert('String#start_with?') do
assert_true "hello".start_with?("heaven", "hell")
assert_true !"hello".start_with?("heaven", "paradise")
+ assert_raise TypeError do "hello".start_with?(true) end
end
assert('String#end_with?') do
assert_true "string".end_with?("ing", "mng")
assert_true !"string".end_with?("str", "tri")
+ assert_raise TypeError do "hello".end_with?(true) end
end