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:
parent
4a9a0eaa69
commit
47f2bd9334
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue