From ac2444c3c9d020b2d0ef1b011b5bdb37d2b4af62 Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Thu, 22 Oct 2020 20:51:14 -0500 Subject: Fix an imprecise spec for `Dash#replace` 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. --- spec/hashie/dash_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/hashie/dash_spec.rb b/spec/hashie/dash_spec.rb index 3adfc8f..c64e400 100644 --- a/spec/hashie/dash_spec.rb +++ b/spec/hashie/dash_spec.rb @@ -344,7 +344,7 @@ describe DashTest do 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 -- cgit v1.2.1