> My problem with something like this:
> 
>    x.should.be.equal.to(y)
> 
> It's very hard to know what "x.should.be" returns.  I can figure it
> out, of course.  But it has a tone of "don't worry about what's
> actually happening; just read the dot-connected words like a string",
> which makes me uncomfortable.

This would be readable assuming that "should" on x meant something. If I 
saw this I'd guess its like "assert".

But, assuming that your list of words DID mean something, then it has to 
be more readable to newcomers (and yourself in 12 mths time) than the 
possible equivalent:

x.each {|an_x| assert_equal y, x}

or to rephrase the example, perhaps:

x.should {|an_x| an_x.be :equal, :to, y}

The magic dot gives you left-to-right readability, whereas the above 
makes you figure out whats happening in the closure first, then go back 
to the x.each part to see where an_x comes from.

Still, you'd have to create an appropriate proxy class for each message 
you want to support. That could be a pain.

All good fun though :)

-- 
Posted via http://www.ruby-forum.com/.