PositiveOperatorMatcher and NegativeOperatorMatcher fail when #send is overwritten
Reported by Arthur Schreiber | July 3rd, 2008 @ 11:38 PM | in No-Milestone-Assigned
PositiveOperatorMatcher and NegativeOperatorMatcher should use #_-send__ instead of #send internally, as there are some classes (e.g. Socket), that overwrite #send with custom behaviour, which RSpec does not like.
Here is an example:
describe "An Object redefining #send" do
before(:each) do
class << (@obj = Object.new)
def send(*args)
0
end
end
end
it "should not make basic matchers fail" do
@obj.should_not == nil
end
end
Comments and changes to this ticket
-
-
Pat Maddox July 13th, 2008 @ 06:19 AM
- → State changed from new to resolved
- → Tag changed from to bug matchers patch
Thanks for the patch. In the future, please provide tests as well :) This is fixed in http://github.com/dchelimsky/rsp...
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Behaviour Driven Development for Ruby.
