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

Spec suite cleanup #216

Closed
wants to merge 3 commits into from
Closed

Conversation

justinko
Copy link
Contributor

Pick what you want :)

@joshuaclayton
Copy link
Contributor

That metadata stuff is pretty insane - not in a bad way, just kinda mind-blowing. I think we're going to pass on that commit (295436b) for now, since most people haven't seen the syntax and prefer to be more straightforward in what's going on with the FactoryGirl::Syntax::Methods inclusion in the various describes. I like where you were going with it though.

At thoughtbot, we use == instead of eq for our specs; is there a clear benefit of using eq over == that I've just not heard about (aside from Ruby not yelling about it if you're raking with warnings on)? If so, please let me know! We'll definitely be grabbing the middle commit to remove all those 'should's from the suite. Same thing for this one - I should be able to get one (or both) of the commits in by Friday.

Thanks!

@justinko
Copy link
Contributor Author

That metadata stuff is pretty insane - not in a bad way, just kinda mind-blowing

Yeah, I hear ya. The metadata stuff isn't actually implemented with code, but black magic. @dchelimsky is a man-witch - wait till you see his costume on Halloween!

Regarding eq. Yes, there is that warning stuff. But also, it is part of a consistent set of matchers for Ruby equality methods:

== # equality of value
eql? # equality of value and type
equal? # same object

Admittedly, you will use == much more than eql? or equal? in your codes, but when you do need to use them, it'll look like this:

"foo".equal?("foo").should be_false
"foo".eql?("foo").should be_true

Unless, of course, you want to use RSpec's equality matchers:

"foo".should eq("foo")
"foo".should eql("foo")
"foo".should equal("foo")

Either way, really not a big deal :)

Thanks for the prompt responses.

@dchelimsky
Copy link

@justinko - I prefer warlock.

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

Successfully merging this pull request may close these issues.

3 participants