[rspec-users] I lost the RSpec fight
court3nay at gmail.com
Mon Sep 17 00:13:50 EDT 2007
Test/spec + mocha
On Sep 16, 2007, at 8:44 AM, "Pat Maddox" <pergesu at gmail.com> wrote:
> On 9/16/07, Jay Levitt <lists-rspec at shopwatch.org> wrote:
>> I've been working on a Rails project with one other developer; he was
>> using Test::Unit, and I was using RSpec. That works OK for a
>> while, but
>> obviously it starts causing pain when you have to check in two
>> places to
>> see if a piece of code is properly tested/spec'd, you can't use
>> shortcuts to switch back and forth between code and test, you have to
>> duplicate shared behaviors/test helpers, etc.
>> So when we brought in a consulting team to add some manpower, we
>> realized we had to switch to a single framework. This is a team
>> fairly experienced with Rails and active in the Rails community,
>> but was
>> quite opposed to choosing RSpec.
>> Here are the arguments I heard against unifying on RSpec:
>> * Test::Unit is ubiquitous. Everyone knows it. This is hard to
>> counter; it comes with Rails and is the default. Same reason many
>> people use Prototype even though JQuery/dojo might suit them better.
>> * For that reason, it's a lot easier to find examples of "how to do
>> something" in Test::Unit than in RSpec. That's true; several times
>> had a bit of code that didn't fall nicely into the MVC hierarchy,
>> and I
>> wasn't sure how to build up the right context to test it in. If I
>> using Test::Unit, I could just copy the equivalent tests from Rails
>> core, but using RSpec I had to roll my own.
>> * RSpec is BDD (hand-waving new different troublesome); we do TDD.
>> We've covered that ground on this list many times; BDD is an
>> and interpretation of TDD, not some newfangled crackpot theory. But
>> people don't know that.
>> * The team had in fact investigated RSpec a few months ago, and
>> they didn't like it. Some of what they didn't like has been fixed in
>> 1.0, but of course people aren't going to come running to re-examine
>> each release, so the bitter taste remained:
>> * #context was defined on Kernel. Not sure if that's still true for
>> * Not compatible with tools that expect Test::Unit output. This
>> would(could) be fixed with the runner integration that's been
>> * Wasn't compatible with mocha/FlexMock. Fixed now.
>> But again, it came back to ubiquity, which is a pretty hard problem
>> Seems to me that the best way to get RSpec adopted is to find some
>> visible, prolific plugin programmers and evangelize them to start
>> RSpec, so it's not some "neat fringe thing", but a solid, respectable
>> alternative to Test::Unit.
>> Jay Levitt
>> rspec-users mailing list
>> rspec-users at rubyforge.org
> Since you've been doing TDD the right way this whole time, hopefully
> you'll be able to maintain (and teach) what you've learned. It might
> be uncomfortable or painful at first but I'm sure you can do it.
> I'm interested to know how your Test::Unit style might have changed
> after using RSpec for a while. I'm also interested to know if you
> "slip" back to your older, different style (if there was one).
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users