[Rspec-devel] should_be_nil or should.be.nil

David Chelimsky dchelimsky at gmail.com
Wed Jun 7 07:15:57 EDT 2006


On 6/6/06, Jay Levitt <lists-rspec at shopwatch.org> wrote:
> What exactly are we voting on when we say "underscores"?  Are we saying
> "my_obj.reader.should_be true", or "my_reader_should_be_true"?  I think
> the former actually conveys intent best - take an existing method like
> my_obj.reader, and call the "should_be" test on it.  Neither
> "my.obj.reader.should.be true" nor "my_obj_reader_should_be_true" convey
> that.  So is that a vote for mixed, or is this actually what you mean by
> underscores?

Jay, it just has to do with the messages you send directly to rspec.
So it's a choice between this:

the_team.should_have_at_least(11).active_players

and this:

the_team.should.have.at.least(11).active_players

where "the_team" is the subject you are specifying, "active_players"
is a collection that it owns and "should_have_at_least" or
"should.have.at.least" is what gets fielded by rspec directly.

RSpec supports both, so the question is not one of functionality -
it's one of documentation. Do we want the docs to sometimes use
"should.equal" and sometimes "should_equal", always "should_equal", or
always "should.equal".

I think it's clear that we don't want mixed. That's just confusing.


More information about the Rspec-devel mailing list