rspec-core icon indicating copy to clipboard operation
rspec-core copied to clipboard

add possibility to use multiple formatters at the same time

Open jarmo opened this issue 16 years ago • 10 comments

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.

jarmo avatar Nov 05 '10 19:11 jarmo

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

jarmo avatar Nov 16 '10 19:11 jarmo

+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).

ches avatar Nov 29 '10 21:11 ches

+1 for multiple formatters support

janmejay avatar Dec 09 '10 06:12 janmejay

@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.

dchelimsky avatar Dec 09 '10 12:12 dchelimsky

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 :-)

ches avatar Dec 10 '10 03:12 ches

+1 for multiple formatters

ghost avatar Dec 30 '10 19:12 ghost

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!).

christopherdolan avatar Dec 30 '10 19:12 christopherdolan

support multiple formatters

  • Closed by a5f9ffd270ff8d450d9460f14b269b48685c4567.

dchelimsky avatar Dec 31 '10 19:12 dchelimsky

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)

grosser avatar Apr 26 '11 18:04 grosser

Ahhh my bad, correct format is rspec spec --format documentation --out rspec.output.txt --format documentation --out rspec.output2.txt

grosser avatar Apr 26 '11 18:04 grosser