In RSpec 1.x it was possible to use multiple formatters at the same time when output was different. In 2.x it seems to be only possible to use 1 if not doing it code-wise.
It would be great to have also native support for multiple since i'm usually using documentation formatter and html formatter together. This makes sense if test-run is longer so i can see quicker feedback on the console window and more details in html report by using some custom formatter.
I've written a short article about this problem and how to solve it until it's natively supported by RSpec 2 for anyone needing it: http://www.itreallymatters.net/post/1592879361/how-to-use-multiple-formatters-in-rspec-2
+1 as well.
Similar to Jarmo, primary use case is for continuous integration -- I'd like a single build to output JUnit XML via CI Reporter gem so that Hudson can track build statistics, and also generate HTML in the same run so it can be published in a friendly format for stakeholders to view. This is a piece of cake with Cucumber's support for multiple formats (and built-in JUnit formatter, incidentally).
+1 for multiple formatters support
@jarmo - thanks for posting the workaround. The reason the reporter supports multiple formatters but the command line does not is that I had started to implement support for multiple formatters but ran into a snag and never finished it.
Keep in mind, when you see regressions like this, that rspec-core-2 is a complete rewrite based on Micronaut, which was not feature complete with rspec-1. I got most of the rspec-1 features implemented before releasing rspec-2, but obviously not 100% of them.
I'll look to getting this fixed soon, though it might not be in the very next release because I want to release some things that have already been implemented.
Thanks David. For me at least, this is a "nice to have" especially since the internal support is there and a workaround based on Jarmo's post is working just fine for me (thanks!). I'd rather the RSpec team focus on things you consider more pressing :-)
+1 for multiple formatters
Now that Github offers a "votes" feature for a given issue, I feel really bad about my +1 and all the +1ing that's resulted from it. Please, other interested parties, just upvote this issue instead of polluting the comments (like me!).
support multiple formatters
Does not seem to work anymore
rspec spec --format documentation:rspec.output.txt
/home/micha/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:270:in `add_formatter': Formatter 'documentation:rspec.output.txt' unknown - maybe you meant 'documentation' or 'progress'?. (ArgumentError)
Ahhh my bad, correct format is rspec spec --format documentation --out rspec.output.txt --format documentation --out rspec.output2.txt
rspec spec --format documentation --out rspec.output.txt --format documentation --out rspec.output2.txt
- Closes #213.