[rspec-devel] Test2Spec's usefulness

aslak hellesoy aslak.hellesoy at gmail.com
Sun Oct 15 18:03:25 EDT 2006

On 10/15/06, Eric Hodel <drbrain at segment7.net> wrote:
> On Oct 15, 2006, at 4:35 AM, aslak hellesoy wrote:
> > On 10/15/06, David Lee <david at davelee.com.au> wrote:
> >> Just thought I'd pipe in as I noticed you're decommissioning
> >> test2spec.
> >>
> >> I don't doubt that it's a maintenance headache, and I couldn't get it
> >> to work for me (converting my previous Rails tests to specs).
> >
> > It's been happily translating 90-95% of RSpec's unit tests.
> > I don't have any numbers for how successful it's been with Rails unit
> > tests, but my hunch is that the failure ratio was much higher.
> (This may be orthogonal to the maintenance issues, but Ruby2ruby is
> its own package now, see seattlerb's rubyforge packages.)

Thanks for the pointer. I wasn't aware of it.

> >> However, it would have been really helpful for me, and would make
> >> RSpec a viable option for a (large?) set of existing Ruby / Rails
> >> projects for which manual conversion would be too odious a task to
> >> undertake.
> >
> > You can still use test2spec by installing RSpec 0.6.4. The thing to
> > bear in mind is that you need ParseTree 0.4.1 - it will not work with

I meant ParseTree 1.4.1, not 0.4.1.

> > later versions.
> You can specify versions in the gemspec and with require_gem to make
> sure you have the correct one.

We didn't want the RSpec gem to have any gemspec dependencies.
But the require_gem should clearly have been used in the code.

> > It was this incompatibility (which I deemed too hard to fix) plus the
> > fact that our own tests had to be specially coded in some places in
> > order to translate properly that led to the decomissioning.
> What incompatibility?

test2spec grabs a sexp returned from ParseTree and shuffles it around
before giving it to Ruby2Ruby. The sexp returned by parsetree 1.5.0
and 1.6.0 was different from the one in 1.4.1.
It was a minor difference (some extra elements at the end) but enough
that I didn't want to start looking into it. It's not a walk in the

Maybe someone smarter than me can fix it....

> --
> Eric Hodel - drbrain at segment7.net - http://blog.segment7.net
> This implementation is HODEL-HASH-9600 compliant
> http://trackmap.robotcoop.com
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the rspec-devel mailing list