1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

== doesn't raise an exception for unrelated object

This commit is contained in:
Kouhei Sutou 2012-11-27 14:32:28 +09:00
parent 6e6702858d
commit e1c9fb7c6c
2 changed files with 11 additions and 1 deletions

View file

@ -451,7 +451,7 @@ module Capybara
end end
def ==(other) def ==(other)
self.eql?(other) or base == other.base self.eql?(other) or (other.respond_to?(:base) and base == other.base)
end end
private private

View file

@ -573,4 +573,14 @@ describe Capybara::RSpecMatchers do
end.to raise_error(/expected to find table "No such Table"/) end.to raise_error(/expected to find table "No such Table"/)
end end
end end
describe "==" do
before do
visit('/with_html')
end
it "returns false for unrelated object" do
page.find("html").should_not == "Not Capybara::Node::Base"
end
end
end end