aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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