output rspec tests on screen while redirecting them to a file

257 views Asked by At

In .rpsec, --format json --out rspec.json

This setting redirects rspec tests results to rspec.json.

At same time I also want to watch these results displaying on screen . Is there a way doing that?

1

There are 1 answers

0
Simple Lime On

RSpec supports multiple formatters in a command. So for instance, I can setup my .rspec file to look like:

--format json
--out rspec.json
--format progress

and when I run rake spec, I see the default progress indicators in the terminal and a rspec.json file is created with the JSON output.