-
-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
have_attributes
matcher shows confusing results for BigDecimal values
#1064
Comments
Thanks for reporting this, @JunichiIto! I agree this is confusing behavior. However, it's not specific to We are aware of this issue and work has started on prototyping a replacement for RSpec's current differ. Once we improve the differ to be more aware of RSpec's matching semantics, and not simply do a string diff, this problem will be fixed for I'm going to close as there's nothing actionable for us to do directly related to the |
@myronmarston Thank you for reply. I understand the background of this problem. I am looking forward to the improvement of the diff. |
Subject of the issue
have_attributes
matcher shows confusing results for BigDecimal values.Your environment
Steps to reproduce
Save the following code as
sample_spec.rb
:Run the script:
Expected behavior
In this case, only the value of name is different, so it should show x and y are OK:
Actual behavior
But it shows as if x and y were also different, and their format seems exponential notation:
This behavior is very confusing because the spec will pass when the value of name is changed to 'foo' (No need to change x and y). And it is very difficult to tell
1.23
and0.123e1
are same or different.The text was updated successfully, but these errors were encountered: