-
-
Notifications
You must be signed in to change notification settings - Fork 753
Conversation
Is it worth considering The other option is to somehow process the formatter loading without the requires having been processed, some sort of placeholder formatter? |
That's one solution. I don't like changing when a
I'm leaning towards the 1st or 2nd ideas. Thoughts? |
I'm thinking we push formatter loading before I don't mind your first suggestion, but it doesn't fix the issue, just avoids it. The second suggestion doesn't really fit the bill, as this is an override of a formatter, not a fallback. |
I would definitely consider this a fallback. The idea of the generated spec_helper is to use the doc formatter when two conditions are met:
It's a fallback because this config is only intended to take affect if nothing else sets a formatter. The more I think about that option, the more I like it. |
Oh I see, you're suggesting we change it so the default formatter when there's only one file to run, yeah ok I'm on board with that. |
That's the entire point of this line of code: rspec-core/lib/rspec/core/project_initializer/spec_helper.rb Lines 36 to 39 in 1e5ea31
|
Yes, but the issue is how that interacts with the overridden formatter, this issue of there being "no formatters" would still exist ;) |
Sure, but the goals of making |
The spec_helper generated by `rspec --init` could cause both the progress and documentation formatter to be used for a command like: rspec path/to/spec.rb --format progress This happened because formatters are loaded _after_ `--require` files, so the `config.formatters.none?` check returned true even though a formatter had been explicitly set at the command line. It's important that requires come first so that custom formatters can be appropriately loaded.
@JonRowe -- I just pushed my implementation of this...care to review? |
Oh yeah, this needs a changelog still -- I'll take care of that later. |
LGTM |
[ci skip]
Add a failing spec for #1343.
Not sure how to fix this yet. Pushing it to start the conversation.