Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Constrain null-object verifying doubles according to their defined interface #392

Closed
myronmarston opened this Issue · 6 comments

3 participants

Myron Marston Michael Gee Xavier Shay
Myron Marston
Owner

More discussion:

#227 (comment)

Michael Gee

Since the pull request is merged, should this issue still be open?

Myron Marston

No. #378 added verifying doubles but it doesn't constrain null-object doubles according to them.

Myron Marston

@xaviershay Do you want to take a stab at this?

Xavier Shay
Collaborator

I'll take out a 7 day lock on it and see how my week goes :)

Xavier Shay xaviershay referenced this issue from a commit in xaviershay/rspec-mocks
Xavier Shay xaviershay Verifying null objects only respond to defined methods.
* Delegated logic from the double to the proxy, since it is near by and
  already knows how to check if a method is implemented.
* No additional documentation, since this is the least surprising
  behaviour.
* Not sufficient duplication to warrant DRYing up the verifying method_missing
  implementations, if these classes start to look any more alike I would
  consider it though.
* verify_method_missing is a terrible method name, but I wanted to tell
  rather than ask rather than including the null object conditional in
  the method_missing implementation.

Fixes #392.
d9121a2
Xavier Shay
Collaborator

@myronmarston see attached PR.

Myron Marston

Closing to focus conversation on #421.

Xavier Shay xaviershay referenced this issue from a commit in xaviershay/rspec-mocks
Xavier Shay xaviershay Verifying null objects only respond to defined methods.
* No additional documentation, since this is the least surprising
  behaviour.

Fixes #392.
538f524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.