Why is `assert_not` preferred over `refute`?

I really don’t understand this design decision. assert_not itself runs assert !given instead of refute given, directly going against the ruby style guide for minitest (which is to always use refute value instead of assert !value)

commit that introduces assert_not

a pull request even tried to change assert_not to use the built in refute method which would be more compliant with the style guide (pull request here) and was rejected under the premis that “minitest might change the behavior of refute” (which makes absolutely no sense to me, we can depend on Minitest to do things the right way and not unexpectedly change core methods for assert, but not refute? it would NEVER change a core method like that)

So, why does the rails team have zero faith that their core testing library will develop their library the right way? (i.e. not upending millions of tests to change a core method that does nothing different from assert_not without warning or reason)

1 Like