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:
parent
4a9a0eaa69
commit
47f2bd9334
@ -19,8 +19,9 @@ describe "String#casecmp independent of case" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "tries to convert other to string using to_str" do
|
it "tries to convert other to string using to_str" do
|
||||||
other = mock('abc')
|
other = mock('x')
|
||||||
def other.to_str() "abc" end
|
other.should_receive(:to_str).and_return("abc")
|
||||||
|
|
||||||
"abc".casecmp(other).should == 0
|
"abc".casecmp(other).should == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user