add possibility to use multiple formatters at the same time #213

Closed
jarmo opened this Issue Nov 5, 2010 · 10 comments

Projects

None yet

6 participants

@jarmo
Contributor
jarmo commented Nov 5, 2010

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
Contributor
jarmo commented Nov 16, 2010

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

@ches
ches commented Nov 29, 2010

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

@janmejay
Contributor
janmejay commented Dec 9, 2010

+1 for multiple formatters support

@dchelimsky
Member

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

@ches
ches commented Dec 10, 2010

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

@ghost
ghost commented Dec 30, 2010

+1 for multiple formatters

@climbupthewalls

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

@dchelimsky
Member

support multiple formatters

@grosser
Contributor
grosser commented Apr 26, 2011

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
Contributor
grosser commented Apr 26, 2011

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

@timcharper timcharper pushed a commit to timcharper/rspec-core that referenced this issue Aug 19, 2011
@dchelimsky dchelimsky support multiple formatters
- Closes #213.
a5f9ffd
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment