diff options
author | stomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-21 19:31:37 +0000 |
---|---|---|
committer | stomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-21 19:31:37 +0000 |
commit | f925899a52ffe9a039f4de117d700d44d9a8b6af (patch) | |
tree | 2cf069ad8ec313ac511a6d8ba35c3ad2a7437721 | |
parent | c7065d113c548efb68dc5a6af1dabf1c8000d795 (diff) | |
download | ruby-f925899a52ffe9a039f4de117d700d44d9a8b6af.tar.gz |
String#casecmp no longer raises TypeError
* See https://bugs.ruby-lang.org/issues/13312
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | spec/rubyspec/core/string/casecmp_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/rubyspec/core/string/casecmp_spec.rb b/spec/rubyspec/core/string/casecmp_spec.rb index 6bfb66e039..fdb888ff2b 100644 --- a/spec/rubyspec/core/string/casecmp_spec.rb +++ b/spec/rubyspec/core/string/casecmp_spec.rb @@ -25,8 +25,16 @@ describe "String#casecmp independent of case" do "abc".casecmp(other).should == 0 end - it "raises a TypeError if other can't be converted to a string" do - lambda { "abc".casecmp(mock('abc')) }.should raise_error(TypeError) + ruby_version_is ""..."2.5" do + it "raises a TypeError if other can't be converted to a string" do + lambda { "abc".casecmp(mock('abc')) }.should raise_error(TypeError) + end + end + + ruby_version_is "2.5" do + it "returns nil if other can't be converted to a string" do + "abc".casecmp(mock('abc')).should be_nil + end end describe "in UTF-8 mode" do |