Skip to content

Commit

Permalink
Mock.replaced_name no longer includes the object_id in the generated …
Browse files Browse the repository at this point in the history
…method name

This solves #67
  • Loading branch information
MaxLap authored and eregon committed Feb 29, 2024
1 parent c49e2d1 commit 58050d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mspec/mocks/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.stubs
end

def self.replaced_name(key)
:"__mspec_#{key.first}_#{key.last}__"
:"__mspec_#{key.last}__"
end

def self.replaced_key(obj, sym)
Expand Down
2 changes: 1 addition & 1 deletion spec/mocks/mock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
RSpec.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')
expect(Mock.replaced_name(Mock.replaced_key(m, :method_call))).to eq(:"__mspec_#{m.object_id}_method_call__")
expect(Mock.replaced_name(Mock.replaced_key(m, :method_call))).to eq(:"__mspec_method_call__")
end
end

Expand Down

0 comments on commit 58050d7

Please sign in to comment.