# Going from Test::Unit to TTD with rspec

**URL:** <https://www.ruby-forum.com/t/going-from-test-unit-to-ttd-with-rspec/150165>\
**Category:** Rails\
**Created:** [October 5, 2008, 4:13am UTC](https://www.ruby-forum.com/t/going-from-test-unit-to-ttd-with-rspec/150165 "2008-10-05T04:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [October 5, 2008, 4:13am UTC](https://www.ruby-forum.com/t/going-from-test-unit-to-ttd-with-rspec/150165/1 "2008-10-05T04:13:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [October 5, 2008, 5:27am UTC](https://www.ruby-forum.com/t/going-from-test-unit-to-ttd-with-rspec/150165/2 "2008-10-05T05:27:31Z")

</div>

On Oct 5, 3:12 am, Matt H. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [October 5, 2008, 6:06am UTC](https://www.ruby-forum.com/t/going-from-test-unit-to-ttd-with-rspec/150165/3 "2008-10-05T06:06:42Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [October 5, 2008, 1:47pm UTC](https://www.ruby-forum.com/t/going-from-test-unit-to-ttd-with-rspec/150165/4 "2008-10-05T13:47:49Z")

</div>

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
