This took me by surprise…
Seems that you can’t use the same name for 2 rspec shared example groups anywhere within your project. If you do, then when you run rake spec
(to run all the specs), then rspec complains that a shared example group was declared with a non-unique name.
This happens even when the calls to shared_examples_for
are contained within a describe block (one would presume that should scope the examples).
At first I tried to work around this by changing the names of the example groups (not ideal, but I can live with it).
But this became more of a problem when I wanted to factor out the example group to a separate file so I could share it between multiple spec files.
The specs work okay when run in isolation, but when I run the suite, rspec complains.
`ensure_shared_example_group_name_not_taken': \
Shared example group 'a person' already exists (ArgumentError)
Surely this is a common problem.
Is there something I’m missing here?