Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Matcher classes in 2.8 pollute the example namespace #105

dchelimsky opened this Issue Jan 9, 2012 · 6 comments


None yet
5 participants

dchelimsky commented Jan 9, 2012

Problem exposed in http://stackoverflow.com/questions/8783097/rspec-2-8-1-broke-my-specs.

All of the new matcher classes in 2.8 are defined in RSpec::Matchers, which is included in every example. This means classes like Match and Change, which are generic enough names that they're likely to appear in applications, will be hidden by RSpec::Matchers::Match/Change/etc.

Move all of them into a separate module that is not included in each example, and reference them with qualified names.

You beat me to it...Thanks!


alindeman commented Jan 9, 2012

+1 Seeing this too 👍

wfarr commented Jan 9, 2012

+1 here as well

@dchelimsky dchelimsky was assigned Jan 10, 2012


dchelimsky commented Jan 10, 2012

For folks following this, if you have a conflict with a name like Match or Change in your specs, just use ::Match or ::Change (or ::Whatever) until this fix is released.

yellow5 commented Jan 10, 2012

+1 as well


dchelimsky commented Jan 12, 2012

Closed by 536cf9e

@dchelimsky dchelimsky closed this Jan 12, 2012

@dchelimsky dchelimsky added a commit that referenced this issue Jan 12, 2012

@dchelimsky dchelimsky Changelog for #105 [ci skip] 867260b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment