Test Drivenn Development in Rails

Hello everyone I had a few questions I just downloaded rcov and have
it up my question is are there any good sites that teach you how to
write TDD in rails.
or any books that can teach me the fundamentals of TDD in rails

Thanks for all the help

GabrielG1976

You can try out BDD since TDD is old concept now. Rspec helps the
developers lot.

http://aaswathaman.blogspot.com/

It would be nice if you can elaborate what do you mean by your
statement (…big projects… RSpec… headache…)

On Jun 16, 10:46 am, Ayyanar Aswathaman <rails-mailing-l…@andreas-
s.net> wrote:

You can try out BDD since TDD is old concept now. Rspec helps the
developers lot.

I’d hardly call TDD new. BDD is newer that TDD, but they’re both
relative newcomers.

Fred

On Jun 17, 8:14 am, Frederick C. [email protected]
wrote:

On Jun 16, 10:46 am, Ayyanar Aswathaman [email protected] wrote:

You can try out BDD since TDD is old concept now. Rspec helps the
developers lot.

I’d hardly call TDD new. BDD is newer that TDD, but they’re both
relative newcomers.

That should of course say ‘I’d hardly call TDD old’. D’oh!

Fred

You can try out BDD since TDD is old concept now. Rspec helps the
developers lot.

BDD is “consultant-friendly”.

BDD can be used as a TDD platform. Either way, we are talking about
driving
development with executable specifications.

Also, technically, whenever at work we try to do something simple in
RSpec, such
as set a session variable before activating the target method, we
invariably get
fragile code. The hooks that Rails adds to Test::Unit::TestCase seem
more
stable, and our RSpec experiments have decayed over time…

Imho, in really big projects Rspec might give you a nice headache.

On Jun 16, 11:46 am, Ayyanar Aswathaman <rails-mailing-l…@andreas-

GabrielG1976 wrote:

Hello everyone I had a few questions I just downloaded rcov and have
it up my question is are there any good sites that teach you how to
write TDD in rails.
or any books that can teach me the fundamentals of TDD in rails

Rails is all about the TDD - getting a test (or a “spec”) to fail first,
then
writing code to pass the test, then refactoring.

The most important aspect of this is a TDD-friendly editor. You need to
minimize the time between changing code and getting test results. That
lets
you test one edit at a time, which is best.

(And under Ruby you often only need one edit to achieve a testable
change,
unlike some other languages.)

Don’t hold your breath waiting for such an editor…

Read the /Agile Web D. with Rails/ book, by the Daves. It
covers TDD as
part of the lifecycle (hence the title “Agile”) - not as an
afterthought.


Phlip

On Jun 17, 6:55 am, Phlip [email protected] wrote:

The most important aspect of this is a TDD-friendly editor. You need to
minimize the time between changing code and getting test results. That lets
you test one edit at a time, which is best.

Don’t hold your breath waiting for such an editor…

rails.vim might be what you are looking for:
http://rails.vim.tpope.net/
there are some great shortcuts for quickly switching between a file
and its test file

Then you just run autotest (http://nubyonrails.com/articles/autotest-
rails) and get instant notification when a test fails.

You can do the same thing in Netbeans 6.1. Shortcut: Shift-Ctrl-T.