Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Conversation

alexpeattie
Copy link
Contributor

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

@myronmarston
Copy link
Member

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?

@alexpeattie
Copy link
Contributor Author

Sure, switched it over :)

@JonRowe
Copy link
Member

JonRowe commented Dec 2, 2013

LGTM but will need a change log entry...

config.add_formatter :documentation
}.not_to change { config.formatters.length }
end
end
Copy link
Member

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.

@alexpeattie
Copy link
Contributor Author

OK added an extra example + Changelog entry.

config.add_formatter :documentation
}.to change { config.formatters.length }
end
end
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea, pushed

JonRowe added a commit that referenced this pull request Dec 3, 2013
Don't allow the same formatter to be sent to the same output
@JonRowe JonRowe merged commit eee5c81 into rspec:master Dec 3, 2013
@JonRowe
Copy link
Member

JonRowe commented Dec 3, 2013

Thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants