Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass -f specdoc option through rake task

I am using rails 2.3.5 .rake spec works fine.

This is from spec --help.

spec --help

-f, --format FORMAT[:WHERE]      Specifies what format to use for output. Specify WHERE to tell
                                    the formatter where to write the output. All built-in formats
                                    expect WHERE to be a file name, and will write to $stdout if it's
                                    not specified. The --format option may be specified several times
                                    if you want several outputs

                                    Builtin formats:
                                    silent|l                 : No output
                                    progress|p               : Text-based progress bar
                                    profile|o                : Text-based progress bar with profiling of 10 slowest examples
                                    specdoc|s                : Code example doc strings
                                    nested|n                 : Code example doc strings with nested groups indented
                                    html|h                   : A nice HTML report
                                    failing_examples|e       : Write all failing examples - input for --example

                                failing_example_groups|g : Write all failing example groups - input for --example

How do I pass -f specdoc through rake task.

like image 685
Nick Vanderbilt Avatar asked May 23 '10 02:05

Nick Vanderbilt


2 Answers

Add or edit a .rspec file to the rails root. For example, mine now contains the following options:

--colour
--format documentation

Note that the new name for the specdoc format is documentation in RSpec 2.1.

like image 60
Steve Avatar answered Nov 20 '22 21:11

Steve


rake spec will respect the SPEC_OPTS environment variable.

rake spec SPEC_OPTS="--format specdoc"
like image 24
trevorgrayson Avatar answered Nov 20 '22 19:11

trevorgrayson