-
-
Notifications
You must be signed in to change notification settings - Fork 752
Don't allow the same formatter to be sent to the same output #1206
Conversation
Thanks, @alexpeattie. I don't think this is something that really warrants a cuke (as they exist primarily for documentation purposes). Can you convert the cuke into a spec? |
Sure, switched it over :) |
LGTM but will need a change log entry... |
config.add_formatter :documentation | ||
}.not_to change { config.formatters.length } | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to have another context "when a duplicate formatter exists for a different output target"
that shows that it keeps both. As this stands, the specs could pass w/o the formatter.output == new_formatter.output
check.
OK added an extra example + Changelog entry. |
config.add_formatter :documentation | ||
}.to change { config.formatters.length } | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd roll these into the same context when a duplicate formatter exists
and then reword the it
:
context "when a duplicate formatter exists" do
it "doesn't add the formatter for the same output"
it "add's the formatter for different output targets"
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea, pushed
Don't allow the same formatter to be sent to the same output
Thanks :) |
Fix (or partial fix) for #1144.
This patch doesn't address the other potential issue - the case of multiple config files. Right now formatters specified in different configuration files override each other (rather than appending the additonal formatters, as is the case elsewhere).