[rspec-users] surprising...

David Chelimsky dchelimsky at gmail.com
Sun Nov 29 08:53:53 EST 2009

On Sun, Nov 29, 2009 at 12:33 AM, rogerdpack <rogerpack2005 at gmail.com>wrote:

> It is somewhat surprising to me, as a newbie, to have to assert
> a.should be_a(Hash)
> That extra space in there feels awkward.
> Suggestion:
> allow for constructs like
> a.should.be_a(Hash)
> Thoughts?

You're about 4 years late to the party. We were playing around with a
variety of options back in 2005 and went with the current syntax because it
gave us the most flexibility and the highest level of decoupling, making it
easier for others to create their own matcher libraries. While it would be
technically feasible to support should.matcher, doing so now would cause
more confusion for more people than be helpful, IMO.

If you're really excited about that syntax (with the dots), there are other
frameworks (test/spec and expectations to name two) that use it or something
similar, so you might want to give those a peek as well.

Good luck!


> Much thanks.
> -r
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20091129/6bad3c86/attachment-0001.html>

More information about the rspec-users mailing list