Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chain bug #38

Closed
wants to merge 0 commits into from
Closed

Conversation

myronmarston
Copy link
Member

No description provided.

@myronmarston
Copy link
Member Author

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

@dchelimsky
Copy link
Contributor

Merged to master and 2-0-stable

eloyesp pushed a commit to eloyesp/rspec-expectations that referenced this pull request Nov 5, 2013
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
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants