Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing format as parameter to rake spec

Tags:

ruby

rake

rspec

My question is similar to this , where they want to override rake spec's output format. The resolution to that question is to use the .rspec config file, which is limiting. I would like this to be a command line argument because I want this to vary on different machines.

The rspec executable has the -f option be defining format. rake spec has -f defining a rakefile. rake spec --format is invalid. Is this an oversight in rake spec? "Format" really isn't an option?

like image 231
trevorgrayson Avatar asked Nov 09 '12 15:11

trevorgrayson


1 Answers

ANSWER: I'm self answering my question here. rake spec will take the SPEC_OPTS environment variable.

rake spec SPEC_OPTS="--format documentation" 
like image 89
trevorgrayson Avatar answered Sep 19 '22 17:09

trevorgrayson