1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use should_receive expectation instead of singleton method

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
stomar 2017-05-21 19:25:19 +00:00
parent 4a9a0eaa69
commit 47f2bd9334

View file

@ -19,8 +19,9 @@ describe "String#casecmp independent of case" do
end
it "tries to convert other to string using to_str" do
other = mock('abc')
def other.to_str() "abc" end
other = mock('x')
other.should_receive(:to_str).and_return("abc")
"abc".casecmp(other).should == 0
end