Adding a *warn-on-spec-replace* var

Description

In Nubank, we had an issue with flaky spec tests. The cause turned out to be two specs with the same name, registered in completely different places. If a project has many specs, it is possible that some specs will have the same name.

To avoid this, I propose having a warn-on-spec-replace var, which defaults to false. If that var is set to true, and a spec is being defined with s/def with the name of an already registered spec, it will output a warning to stderr.

The discussion which originated this idea, by , can be found here.

I'd like to note that I couldn't quite think of a way to test this output existing or not, mainly because I am not very good with Clojure macros. So pray tell me if there is a way to test this behavior.

Environment

None

Assignee

Léo Vital

Reporter

Léo Vital

Labels

Priority

Minor