You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fails because the default delta value for refute_in_delta is 0.001. As Rubocop can never know the user's intended delta value this cop is not safe for autocorrect.
Don't know whether you'd consider Minitest/RefuteInDelta unsafe also, as if you replace the assertion in the above example with assert_equal, autocorrect turns a failing test into one that passes..
I'd also suggest the suggestion text for bothcops use the good code examples where an explicit delta value is provided.
The text was updated successfully, but these errors were encountered:
.rubocop.yml
test/test_minitest_assert_in_delta.rb
$ ruby test/test_minitest_assert_in_delta.rb
=> pass
$ rubocop
$ rubocop -a
=> autocorrected
$ ruby test/test_minitest_assert_in_delta.rb
=> fail
Fails because the default delta value for
refute_in_delta
is 0.001. As Rubocop can never know the user's intended delta value this cop is not safe for autocorrect.Don't know whether you'd consider Minitest/RefuteInDelta unsafe also, as if you replace the assertion in the above example with
assert_equal
, autocorrect turns a failing test into one that passes..I'd also suggest the suggestion text for both cops use the good code examples where an explicit delta value is provided.
The text was updated successfully, but these errors were encountered: