David Chelimsky wrote:
> The RSpec Development Team is pleased to announce the release of RSpec 0.7.0.
>
> You can get it from http://rubyforge.org/frs/?group_id=797, or "gem
> install rspec"
>
> Note that this release is NOT completely backwards compatible. If you
> are already using a prior release of rspec, see
> http://rspec.rubyforge.org/upgrade.html before you upgrade.
>
> RSpec is the original BDD framework for Ruby. This release includes a
> number of significant improvements, most notably in the areas of
> mocks/stubs and the RSpec on Rails plugin. Learn more at:
>
> http://rspec.rubyforge.org/documentation/mocks/index.html
> http://rspec.rubyforge.org/documentation/rails/index.html
>
> See http://rspec.rubyforge.org/changes.html for a complete list of changes.
>
> Thanks to all who contributed to this release, and to who all will
> contribute in the future by using it and providing us with valuable
> feedback.
RSpec is really looking great. I'm curious though, why offer:
actual.should == <value> #passes if actual == <value>
Yet not extrapolate this techniquw to other methods? I've played with
this approach myself and it would seem to greatly simplify the
underlying code and be most intuitive. Just to be clear, instead of
actual.should_equal <value> #passes if actual.equal? <value>
actual.should_not_equal <value> #passes if !actual.equal? <value>
actual.should_eql <value> #passes if actual.eql? <value>
actual.should_not_eql <value> #passes if !actual.eql? <value>
use
actual.should.equal? <value> #passes if actual.equal? <value>
actual.should_not.equal? <value> #passes if !actual.equal? <value>
actual.should.eql? <value> #passes if actual.eql? <value>
actual.should_not.eql? <value> #passes if !actual.eql? <value>
This can be extended to other methods as well. For example:
actual.should.raise
My 2c.
That's hilarious! You've missed a lot of history. No offense. We went
through a lot of song and dance about this, that's all.
Originally, all of the methods were should_equal, should_match, etc.
Then I came up w/ this dumb idea to add should_be_anything and have it
call .anything? under the hood. Everybody loved the idea, but HATED
the dots!!!!!!
Then Rich Kilmer introduced the underscore sugar that lets you say
"should_do_stuff" but under the hood it called "should.do.stuff".
Ah, but then it still wasn't over! We started running into collision
after collision on methods that called in the middle of that stack.
And so on and so on and so on.
At this point it's pretty stable. Under the hood, it really does use
something that pans out to object.should.equal value. So
actual.should_not.equal expected will probably work - but I doubt
we'll be supporting that officially.
Cheers,
David
···
On 11/6/06, Trans <transfire@gmail.com> wrote:
Thanks,
T.