Testing a single Example; Spec; Testcase; Test

UPDATE: everything is now on github

Testing a single spec, a single test, a single testcase or a single example is a great timesaver when debugging a small problem while having a large testsuite, or a testsuite with a lot of failures…

  • rake test:blog -> only the Blog Testcase
  • rake spec:blog -> only the Blog Spec
  • rake test:blog:create -> only the tests matching /create/ in Blog
  • rake spec:blog:delete -> only the first example matching /create/ in Blog
  • rake test:’admin/blogs_con’ -> only BlogsController Test in admin folder
  • rake test:xy -> first test matching xy*_test.rb (searched in order: unit,functional,integration,any folder)

It will search in unit/functional/integration (test) and models/controllers/views/helpers(spec).
Idea

Install:
UPDATE: everything is now on github