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

Jay Levitt lists-rspec at shopwatch.org
Wed Jun 7 08:08:09 EDT 2006


David Chelimsky wrote:

> 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.

Ah, ok.  I wasn't sure if the rspec dot-magic extended to object names, 
method access, etc. as well, so that we might be talking about

the.team.should.have.at.least(11).active.players

or, vice versa (if there were a method "teams.winner")

teams_winner_should_have_at_least(11)_active_players

both of which would be horrible.

I'm +1 on underscores.

Jay

> 
> 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.
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel



More information about the Rspec-devel mailing list