summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/mocks/mock_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/spec/mocks/mock_spec.rb')
-rw-r--r--spec/mspec/spec/mocks/mock_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/mspec/spec/mocks/mock_spec.rb b/spec/mspec/spec/mocks/mock_spec.rb
index 1a7fb2d567..d996b5285c 100644
--- a/spec/mspec/spec/mocks/mock_spec.rb
+++ b/spec/mspec/spec/mocks/mock_spec.rb
@@ -22,16 +22,14 @@ end
describe Mock, ".replaced_name" do
it "returns the name for a method that is being replaced by a mock method" do
m = double('a fake id')
- m.stub(:__mspec_object_id__).and_return(42)
- Mock.replaced_name(m, :method_call).should == :__mspec_42_method_call__
+ Mock.replaced_name(m, :method_call).should == :"__mspec_#{m.object_id}_method_call__"
end
end
describe Mock, ".replaced_key" do
it "returns a key used internally by Mock" do
m = double('a fake id')
- m.stub(:__mspec_object_id__).and_return(42)
- Mock.replaced_key(m, :method_call).should == [:__mspec_42_method_call__, :method_call]
+ Mock.replaced_key(m, :method_call).should == [:"__mspec_#{m.object_id}_method_call__", :method_call]
end
end