diff options
author | stomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-21 19:25:19 +0000 |
---|---|---|
committer | stomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-21 19:25:19 +0000 |
commit | 47f2bd93347b3acc04cbb2cd44ca25e87c0d0ab5 (patch) | |
tree | 2039cacaeaf002512127cd2421901f7e06a782cb /spec | |
parent | 4a9a0eaa698911c612b36aac16979ce9a04cae4a (diff) |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/rubyspec/core/string/casecmp_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/rubyspec/core/string/casecmp_spec.rb b/spec/rubyspec/core/string/casecmp_spec.rb index c5503a18bf..6bfb66e039 100644 --- a/spec/rubyspec/core/string/casecmp_spec.rb +++ b/spec/rubyspec/core/string/casecmp_spec.rb @@ -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 |