Skip to content
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

assert_equal arguments are backward #1

Closed
dchelimsky opened this issue Aug 21, 2012 · 3 comments
Closed

assert_equal arguments are backward #1

dchelimsky opened this issue Aug 21, 2012 · 3 comments

Comments

@dchelimsky
Copy link

In test/unit, minitest, junit, etc, the arguments are actual, expected. This allows you to read "assert_equal foo, bar" as "assert_equal_foo bar".

Ironically, that people often screw up the order of these arguments was one of the initial motivations for "actual.should eq(expected)". FWIW. From one grump to another ;)

@hopsoft
Copy link
Owner

hopsoft commented Aug 22, 2012

Thanks for the heads up. I'll swap them.

@dchelimsky
Copy link
Author

Cool. Also - I don't know if you know this but RSpec will let you use asserts like this:

RSpec.configure {|c| c.expect_with :stdlib}

That pulls in the assertions from test/unit in Ruby < 1.9, and MiniTest in Ruby >= 1.9. Won't give you RSpec's failure messaging, but that's how most folks are handling this these days.

@hopsoft
Copy link
Owner

hopsoft commented Aug 22, 2012

I wasn' t aware they were still supporting this. GrumpyOldMan preserves the nice RSpec error formatting.

The arg order has been fixed.

@hopsoft hopsoft closed this as completed Aug 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants