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.
Matt H. (Guest)
on 2008-10-05 06: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
Frederick C. (Guest)
on 2008-10-05 07:27
(Received via mailing list)
On Oct 5, 3:12 am, Matt H. <removed_email_address@domain.invalid> 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
DyingToLearn (Guest)
on 2008-10-05 08:06
(Received via mailing list)
Frederick C. 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
Matt H. (Guest)
on 2008-10-05 15: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.