aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-21 19:25:19 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-21 19:25:19 +0000
commite8312dc70e7a256301a51faf3e746c27dcf11c59 (patch)
tree2039cacaeaf002512127cd2421901f7e06a782cb /spec
parent9e010df8811bb64933f73a12c354755ed9d74bc1 (diff)
downloadruby-e8312dc70e7a256301a51faf3e746c27dcf11c59.tar.gz
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.rb5
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