Forum: Ruby on Rails Going from Test::Unit to TTD with rspec

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2008-10-05 04:13
(Received via mailing list)
Hi all,

I've been writing apps and using retrospectively written tests with
Test::Unit.

I want to get into TTD with rspec but all of the resources I've found
are either quite vague or out of date.

Can anyone point me to a good resource to get me started with TTD/rspec
in a rails app?

Something with some nice examples maybe, and something that tells you
how to actually run the tests would be great.

Thanks

Matt
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-10-05 05:27
(Received via mailing list)
On Oct 5, 3:12 am, Matt Harrison <iwasinnamuk...@genestate.com> wrote:
> Hi all,
>
> I've been writing apps and using retrospectively written tests with
> Test::Unit.
>
> I want to get into TTD with rspec but all of the resources I've found
> are either quite vague or out of date.
>
> Can anyone point me to a good resource to get me started with TTD/rspec
> in a rails app?

Not exactly what you asked, but you do realise that you can do TDD
with Test::Unit (or any testing framework really). It's a shift in
mentality more than anything else. Some people like the language that
rspec uses, others don't but that's slightly orthogonal to whether
you're TDD'ing or not

Fred
A45f650cce5746dd89aafb3176b47b02?d=identicon&s=25 DyingToLearn (Guest)
on 2008-10-05 06:06
(Received via mailing list)
Frederick Cheung wrote:
> you do realise that you can do TDD
> with Test::Unit (or any testing framework really). It's a shift in
> mentality more than anything else.

+1 to that.

I love and use RSpec (I never _really_ learned Test::Unit). But if you
already know Test::Unit then I'd recommend that you try TDD with
Test::Unit. You can practice the workflow/mindset of writing a failing
test, then coding to make it pass (and then refactoring) without
having to learn new syntax at the same time.

To actually answer your question: I think the best place to learn
RSpec is the peepcode screencasts:
https://peepcode.com/products/rspec-basics

There are three of them. I couldn't say which is best since I don't
know how much you know about RSpec, but if you can afford $27 then you
should buy all three.

HTH
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2008-10-05 13:47
(Received via mailing list)
DyingToLearn wrote:
> test, then coding to make it pass (and then refactoring) without
> having to learn new syntax at the same time.

Thats a very good point both of you have made, I guess I got pulled in
to the fact that most people like to use TTD with something other than
Test::Unit, but you're both right, there doesn't seem to be any reason
why I shouldn't start working like this.

I will have a look at the screencasts some time but for now I will give
TTD and Test::Unit a shot :)

Thanks for your input

Matt
This topic is locked and can not be replied to.