Re: [rspec-users] Test::Unit to RSpec

2007-08-23 Thread David Rice

On 23 Aug 2007, at 20:23, Scott Taylor wrote:



On Aug 23, 2007, at 12:18 PM, David Rice wrote:


Scott,

There was a thread about this earlier... You might be interested in
this plugin I wrote. Kinda basic but worked for me.

http://www.davidjrice.co.uk/articles/2007/8/12/ruby-on-rails-plugin-
test-unit-to-rspec-converter


Yeah - actually I saw it, and tried it out.  Although I can't lie -
it didn't work well.  I can't imagine any translator really working
well.  How would you add mocks + stubs + clear specifications + 1
test-per-spec in a translator, and do it intelligently?



Totally :) Yeah there's so many different syntax variants that it  
becomes hard across testing styles.
Especially now that all of my test suites are converted over to  
RSpec... I really don't think the complexity is worth it because for  
the people that use the tool it instantly becomes useless after they  
are "converted".



But, for what it's worth - it did what I expected it to do, and would
be a good, but crude way, to translate a lot test::unit code to rspec.

Thanks for the tool (and have you looked into the old rspec one -
test2spec, I believe it was called)?



No problem! Yeah the original was very interesting to look at once I  
realised it did exist and wasn't a dream ( I went on a fruitless hunt  
before rolling my own ).



Scott




Best,
Dave


On 18 Aug 2007, at 09:38, Scott Taylor wrote:



So I've just started working on a rails project which currently has
something like 7500 LOC.  All of the tests are written in  
Test::Unit,

although the test coverage is pretty poor: rcov says that 25% of the
code is covered, while rake stats shows the code to test ratio as
1:0.1 (800 lines of test code).

I guess I'm wondering what would generally be advisable here.  Is it
worth it to work on (or use) a test:unit => spec translator?  Should
I just start using rspec when I need to start writing code, and
perform regressions when need be?  Or is the project too big to even
consider using rspec?

Thanks in advance for any experienced advice,

Scott Taylor
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


---
David Rice
http://www.davidjrice.co.uk




___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


---
David Rice
+44 (0)78 708 12996
http://www.davidjrice.co.uk




___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Test::Unit to RSpec

2007-08-23 Thread Scott Taylor

On Aug 23, 2007, at 12:18 PM, David Rice wrote:

> Scott,
>
> There was a thread about this earlier... You might be interested in  
> this plugin I wrote. Kinda basic but worked for me.
>
> http://www.davidjrice.co.uk/articles/2007/8/12/ruby-on-rails-plugin- 
> test-unit-to-rspec-converter

Yeah - actually I saw it, and tried it out.  Although I can't lie -  
it didn't work well.  I can't imagine any translator really working  
well.  How would you add mocks + stubs + clear specifications + 1  
test-per-spec in a translator, and do it intelligently?

But, for what it's worth - it did what I expected it to do, and would  
be a good, but crude way, to translate a lot test::unit code to rspec.

Thanks for the tool (and have you looked into the old rspec one -  
test2spec, I believe it was called)?

Scott


>
> Best,
> Dave
>
>
> On 18 Aug 2007, at 09:38, Scott Taylor wrote:
>
>>
>> So I've just started working on a rails project which currently has
>> something like 7500 LOC.  All of the tests are written in Test::Unit,
>> although the test coverage is pretty poor: rcov says that 25% of the
>> code is covered, while rake stats shows the code to test ratio as
>> 1:0.1 (800 lines of test code).
>>
>> I guess I'm wondering what would generally be advisable here.  Is it
>> worth it to work on (or use) a test:unit => spec translator?  Should
>> I just start using rspec when I need to start writing code, and
>> perform regressions when need be?  Or is the project too big to even
>> consider using rspec?
>>
>> Thanks in advance for any experienced advice,
>>
>> Scott Taylor
>> ___
>> rspec-users mailing list
>> rspec-users@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>
> ---
> David Rice
> http://www.davidjrice.co.uk
>
>
>
>
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] Test::Unit to RSpec

2007-08-23 Thread David Rice

Scott,

There was a thread about this earlier... You might be interested in  
this plugin I wrote. Kinda basic but worked for me.


http://www.davidjrice.co.uk/articles/2007/8/12/ruby-on-rails-plugin- 
test-unit-to-rspec-converter


Best,
Dave


On 18 Aug 2007, at 09:38, Scott Taylor wrote:



So I've just started working on a rails project which currently has
something like 7500 LOC.  All of the tests are written in Test::Unit,
although the test coverage is pretty poor: rcov says that 25% of the
code is covered, while rake stats shows the code to test ratio as
1:0.1 (800 lines of test code).

I guess I'm wondering what would generally be advisable here.  Is it
worth it to work on (or use) a test:unit => spec translator?  Should
I just start using rspec when I need to start writing code, and
perform regressions when need be?  Or is the project too big to even
consider using rspec?

Thanks in advance for any experienced advice,

Scott Taylor
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


---
David Rice
http://www.davidjrice.co.uk




___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Test::Unit to RSpec

2007-08-19 Thread Scott Taylor

So I've just started working on a rails project which currently has  
something like 7500 LOC.  All of the tests are written in Test::Unit,  
although the test coverage is pretty poor: rcov says that 25% of the  
code is covered, while rake stats shows the code to test ratio as  
1:0.1 (800 lines of test code).

I guess I'm wondering what would generally be advisable here.  Is it  
worth it to work on (or use) a test:unit => spec translator?  Should  
I just start using rspec when I need to start writing code, and  
perform regressions when need be?  Or is the project too big to even  
consider using rspec?

Thanks in advance for any experienced advice,

Scott Taylor
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] Test::Unit to RSpec Converter

2007-08-13 Thread aslak hellesoy
On 8/13/07, David Rice <[EMAIL PROTECTED]> wrote:
> Hey, just posting in case this is of interest.
>
> I just recently wrote a Rails plugin to convert Rails Test::Unit cases to
> RSpec.
>
> http://www.davidjrice.co.uk/articles/2007/8/12/ruby-on-rails-plugin-test-unit-to-rspec-converter
>
> it's not going to work 100% in every case, but it's really helped me convert
> old tests to the lovely RSpec :)
>

Thanks David,

We used to have one of those too. The first one was similar to yours,
then I wrote one based on ParseTree and Ruby2Ruby which did the
transformation on the syntax tree level. We ditched it because it was
too much work to maintain (it's still part of older releases - around
0.7 IIRC).

In many cases, simple is better :-)

Aslak

> Best,
> Dave
>
>
> ---
> David Rice
> http://www.davidjrice.co.uk
>
>
>
>
>
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


[rspec-users] Test::Unit to RSpec Converter

2007-08-12 Thread David Rice

Hey, just posting in case this is of interest.

I just recently wrote a Rails plugin to convert Rails Test::Unit  
cases to RSpec.


http://www.davidjrice.co.uk/articles/2007/8/12/ruby-on-rails-plugin- 
test-unit-to-rspec-converter


it's not going to work 100% in every case, but it's really helped me  
convert old tests to the lovely RSpec :)


Best,
Dave

---
David Rice
http://www.davidjrice.co.uk




___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users