From c424707ac08e8ba4e88db5766f0d9142ac4077c0 Mon Sep 17 00:00:00 2001 From: Sergey Udurminskiy Date: Thu, 22 Nov 2018 18:26:37 +0500 Subject: [PATCH] fix: correct getting attribute value in rspec matcher sometimes `@subject[@attribute]` return `nil` instead correct value and we can recieved so message ``` Failure/Error: it { is_expected.to normalizy(:service_email).from('Email@example.com').to 'email@example.com' } expected: "email@example.com" got: "email@example.com" ``` --- lib/normalizy/rspec/matcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/normalizy/rspec/matcher.rb b/lib/normalizy/rspec/matcher.rb index 427c144..3501016 100644 --- a/lib/normalizy/rspec/matcher.rb +++ b/lib/normalizy/rspec/matcher.rb @@ -58,7 +58,7 @@ def matches?(subject) else @subject.send :"#{@attribute}=", @from - @subject[@attribute] == @to + @subject.send(@attribute) == @to end end