[rspec-devel] underscores, sugar, and more and more bugs

Wilson Bilkovich wilsonb at gmail.com
Mon Nov 20 15:06:03 EST 2006

On 11/19/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> I sent this earlier under with the subject "artificial sugar causes
> cancer" and I think some spam filters ate it. Here it is again:
> ======================================
> All,
> If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149
>  you'll see that Chad (the submitter) found the source of the bug.
> Unfortunately, the source of *this* bug is the *solution* to a
> *previous bug* in which Rails was replacing RSpec's method missing
> with its own.
> When we settled on underscores, my one reservation was that we'd keep
> running into this particular problem - RSpec's method_missing
> conflicting with others.

My opinion remains something like this:
1. Do away with underscores that require method_missing.
2. Implement all non-dynamic 'should' methods directly on Object.
3. Split anything dynamic with a period.

@thing.should_arbitrary_predicate becomes @thing.should.arbitrary_predicate
However, @thing.should_have(3).things would remain unchanged.

sugar.rb is a nightmare. As evidence, I present the fact that my
original .method_should_be_changed_by {block} patch was rejected
because it needed to modify sugar.rb.

Even the core team doesn't want to touch it. :)

More information about the rspec-devel mailing list