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

David Chelimsky dchelimsky at gmail.com
Mon Nov 20 15:46:16 EST 2006

On 11/20/06, Nick Sieger <nicksieger at gmail.com> wrote:
> On 11/20/06, Wilson Bilkovich <wilsonb at gmail.com> wrote:
> >
> > 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.
> I agree with this, thanks for summing it up more succintly than I was able
> to earlier.

Again, does anyone see a big difference between:

@thing.should_be :something

For me, the latter cleanly separates what is framework (should_be)
from what is supposed to be in your code (:something)

Either allows us to eliminate method_missing, so this is purely a
syntax question.


> > 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. :)
> Is this a remant from that fateful drunken night of Steve's that birthed
> RSpec? :-)

1. Steve's drunken brainchild was all the methods right on Object
2. I introduced should_be.arbitrary_predicate
3. We decided to make it all dots: should.be.arbitrary_predicate,
should.equal, etc. This allowed us to unclutter Object and make the
underlying implementation more OO
4. dot-hater Rich Kilmer provided the very sexy sugar module
5. we went all underscores using sugar

I want to point out that sugar is no less sexy now than it was to
begin with. The problem is that rspec has to support other frameworks
like rails that do the same sexy stuff, hence the conflicts.

I think the lesson, for me, is that sexy is not always that sexy in a framework.

> /Nick
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the rspec-devel mailing list