opsb
opsb

Reputation: 30231

How to format rspec 2 output with rails 3

When I run rspec 2 with rails 3 I use

rake rspec

sometimes I'd like to use a different formatter, perhaps doc.

rake rspec --format doc

but unfortunately the option doesn't make it through to the rspec runner. How can I choose a different format when I run the command?

Upvotes: 6

Views: 2415

Answers (2)

0x4a6f4672
0x4a6f4672

Reputation: 28245

You can also skip rake and use the rspec command directly. In this case the --format option can be used to tell RSpec how to format the output, "documentation" (or "doc") and "progress" are valid options:

rspec spec --format doc

This is especially useful if you want to run a single test/spec file

rspec spec/models/your_model.rb --format doc

Upvotes: 0

Steve
Steve

Reputation: 15736

You can add default options to an .rspec file in the rails root folder. e.g.

--colour
--format documentation

Upvotes: 12

Related Questions