-
-
Notifications
You must be signed in to change notification settings - Fork 761
Provide a way to programmatically remove formatters #2763
Comments
Ah, a bit too hasty. It seems that |
What do you collect from this dry run exactly? Just the example ids? |
@pirj Yep, I want to obtain the example ids of a subset of the files. skroutz/rspecq#36 is what I came up with. Do you think it's better to do this via |
The RSpec globals are intended for use by RSpec itself in a single pass, but you can create your own versions of configuration, world etc and use those when you need something more complex. In theory you should be able to duplicate a config and add the formatter / dry run for this purpose. |
@agis If Just a word of precaution specifically about splitting by examples. Examples may have stateful setup. The simplest example is: before(:all) { @admin = create(:admin) }
before(:each) { sign_in @admin } Sometimes, this setup is so heavy that it takes the majority of the spec run time. The same applies to splitting by example groups, as they similarly can have shared setup. So in a generic case, I'd stick to splitting by spec files. |
Thanks for the heads up @pirj. In the generic case, we do schedule whole spec files. We only split very slow files to individual examples (see documentation). |
Currently there's
#add_formatter
for registering a new formatter. But there's no counterpart to remove one. This would be useful in skroutz/rspecq#6 or other custom runners maybe. The rationale is that we want to run a dry-run with a JSON formatter to grab the example IDs, and right after (in the same process) issue the regular run.I'd like to do something like this:
Does that sound reasonable? Or perhaps there's already a way to do this that slipped my eyes? Thanks in advance!
The text was updated successfully, but these errors were encountered: