mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
102ec7f4ca
commit
7406d7cffa
1 changed files with 10 additions and 2 deletions
|
@ -25,9 +25,17 @@ describe "String#casecmp independent of case" do
|
|||
"abc".casecmp(other).should == 0
|
||||
end
|
||||
|
||||
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
|
||||
describe "for non-ASCII characters" do
|
||||
|
|
Loading…
Reference in a new issue