How to run only the latest/a given test using Rspec?

Posted by marcgg on Stack Overflow See other posts from Stack Overflow or by marcgg
Published on 2010-03-08T14:31:46Z Indexed on 2010/03/08 14:36 UTC
Read the original article Hit count: 265

Filed under:
|
|
|
|

Let's say I have a big spec file with 20 tests because I'm testing a large model and I had no other way of doing it :

describe Blah
  it "should do X" do ... end
  it "should do Y" do ... end
  ...
  it "should do Z" do ... end
end

Running a single file is faster than running the whole test suite, but it's still pretty long. Is there a way to run the last one (ie the one at the end of the file, here "should do Z")?

If this is not possible, is there a way to specify which test I want to run in my file ?

© Stack Overflow or respective owner

Related posts about TDD

Related posts about ruby