6

I can rake spec and all specs run.

However trying to run specs for one directory, as in

rake spec/models/ or rake spec/models/*.rb 

does not provide any output or errors.

One option is that I can do

rspec spec/models/*.rb

or

rspec spec/models/

but I was wondering if I could stay within Rake.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • May be you can read this http://stackoverflow.com/questions/143925/how-do-you-run-a-single-test-spec-file-in-rspec – Bigxiang Sep 01 '13 at 03:37

2 Answers2

3

Try rake spec:models instead of rake spec/models. Run rake -T | grep spec to see all the available rake spec tasks.

UPDATE: Running your specs through rake spec may be slower than running them through rspec spec, said by the rspec-rails guys. Read de installation section of rspec-rails.

carpamon
  • 6,515
  • 3
  • 38
  • 51
1

Use SPEC env. variable: rake spec SPEC=spec/models

brauliobo
  • 5,843
  • 4
  • 29
  • 34