From 0e8efd4a218f3d235f88054f0d9d11f8bfdcfd33 Mon Sep 17 00:00:00 2001 From: Tomoyuki Sahara Date: Fri, 23 Aug 2013 13:42:43 +0900 Subject: Check type of arguments for #start_with and #end_with. --- mrbgems/mruby-string-ext/test/string.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mrbgems/mruby-string-ext/test/string.rb') 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 -- cgit v1.2.3