O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running Our Test

Having written our first test, we’d like to execute it. Although RSpec provides Rake tasks for executing RSpec, I recommend using the rspec command directly to avoid the overhead of starting up Rake. If you use rspec with no arguments, then RSpec will run over the entire spec directory. You can also give RSpec an individual file, directory, or line to run. For full details on those options, see Chapter 15, Running Tests Faster and Running Faster Tests.

What Happens When We Run the Test?

It fails. We haven’t written any code yet.

That’s Funny. What Really Happens—Internally?

When you run rspec with no arguments, RSpec loads every file in the spec directory. The following things happen (this process is slightly simplified for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required