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

Fix chain bug #38

Closed
wants to merge 0 commits into
from

Conversation

Projects
None yet
2 participants
Owner

myronmarston commented Oct 22, 2010

No description provided.

Owner

myronmarston commented Oct 23, 2010

Fix matcher chaining to prevent name collisions.

Previously, #chain used #define_method on the class to define an instance method on all instances. We want it to define the method on only this instance, so we need to delegate to the singleton class instead (which the recently added #define_method does for us!).

Owner

dchelimsky commented Oct 23, 2010

Merged to master and 2-0-stable

@eloyesp eloyesp pushed a commit to eloyesp/rspec-expectations that referenced this pull request Nov 5, 2013

@myronmarston myronmarston Rewrite custom matcher DSL.
Rather than evaling the `define` block in the
context of the matcher instance, eval the `define`
block in the context of the matcher instance's
singleton class.

* Fixes rspec#272.
  `include` in `define` has a different meaning (module inclusion)
  than `include` in the `match` block (using the `include` matcher to
  match).
* Better solution than rspec#194
  for rspec#188. There's now
  a `match` class method and a `match` instance method.
* Completely avoids issues we had to use hacks to solve before:
  rspec#29,
  rspec#38,
  rspec@fc4b66d
ec0094c

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment