1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2022-07-27 17:18:25 +02:00
parent 44f42413e6
commit 6582df26dc
41 changed files with 527 additions and 55 deletions

View file

@ -13,6 +13,20 @@ describe "String#include? with String" do
StringSpecs::MyString.new("hello").include?(StringSpecs::MyString.new("lo")).should == true
end
it "returns true if both strings are empty" do
"".should.include?("")
"".force_encoding("EUC-JP").should.include?("")
"".should.include?("".force_encoding("EUC-JP"))
"".force_encoding("EUC-JP").should.include?("".force_encoding("EUC-JP"))
end
it "returns true if the RHS is empty" do
"a".should.include?("")
"a".force_encoding("EUC-JP").should.include?("")
"a".should.include?("".force_encoding("EUC-JP"))
"a".force_encoding("EUC-JP").should.include?("".force_encoding("EUC-JP"))
end
it "tries to convert other to string using to_str" do
other = mock('lo')
other.should_receive(:to_str).and_return("lo")