Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rspec - Format output as Progress/Documentation/HTML

Tags:

rspec

Using Rspec, I want to be able to both see the standard progress bar, and output to a file containing the generated spec sheet in documentation format, and also have an html file generated, without running the tests multiple times.

How do I assign multiple formats and file targets for those formats?

like image 214
GlyphGryph Avatar asked Nov 08 '11 16:11

GlyphGryph


1 Answers

I figured out how to do this. You can add the following to your .rspec file (or wherever you want to throw in these options, really)

--format progress
--format documentation --color -o "documentation/file"
--format html -o "web/file"

You can add multiple formats, and it will do ALL of them. You can then set the target of those formats (so they aren't just interlaced in your standard output) with the "-o" command, followed by the name of the file to create.

like image 53
GlyphGryph Avatar answered Oct 20 '22 00:10

GlyphGryph