Skip to content

Commit

Permalink
Fix an imprecise spec for Dash#replace
Browse files Browse the repository at this point in the history
The check here doesn't make sense because it's testing the behavior of
another method. The best way to check identity is but checking the
`#object_id` of an object - thus, this check actually does what the test
says it does.
  • Loading branch information
michaelherold authored and Michael Herold committed Oct 23, 2020
1 parent 75410a6 commit ac2444c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/hashie/dash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class KeepingMash < Hashie::Mash
before { subject.replace(first_name: 'Cain') }

it 'return self' do
expect(subject.replace(email: 'bar').to_hash).to eq(email: 'bar', count: 0)
expect(subject.replace(email: 'bar').object_id).to eq subject.object_id
end

it 'sets all specified keys to their corresponding values' do
Expand Down

0 comments on commit ac2444c

Please sign in to comment.