10

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?

1 Answer 1

20

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.

Sign up to request clarification or add additional context in comments.

1 Comment

maybe you know how get all ruby puts in console and in generated html file? When I write --format html -o "web/file", I get html without my logs, but I need it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.