[rspec-devel] Test2Spec's usefulness

aslak hellesoy aslak.hellesoy at gmail.com
Sun Oct 15 07:35:56 EDT 2006

On 10/15/06, David Lee <david at davelee.com.au> wrote:
> Hi all,
> 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.

> 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
later versions.

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.

> I'm not really doing anything useful here, just flagging that I think
> it is / would be a useful tool to have. Maybe it should wait though
> until RSpec itself has settled down a little ...
> Alternatively, a few Rake tasks to help people manage using both
> Test::Unit & RSpec in parallel on Rails projects might be a useful
> addition to the rails plugin, with minimal maintenance burden.

You can already do that. Just install RSpec on Rails and define a task:

task :test_and_spec => :test, :spec

You should tweak your spec_helper.rb so that it points to fixtures
under test/fixtures rather than the default, which is spec/fixtures.

Please continue posting any problems you have with test2spec - we'll
help you troubleshoot it.


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

More information about the rspec-devel mailing list