Merge pull request #782 from ineverov/size_instead_of_count

Use size instead of count
This commit is contained in:
Jonas Nicklas 2012-08-30 07:24:25 -07:00
commit 5c79469259
1 changed files with 3 additions and 3 deletions

View File

@ -19,14 +19,14 @@ module Capybara
end
def find!
raise find_error if @result.count != 1
raise find_error if @result.size != 1
@result.first
end
def find_error
if @result.count == 0
if @result.size == 0
Capybara::ElementNotFound.new("Unable to find #{@query.description}")
elsif @result.count > 1
elsif @result.size > 1
Capybara::Ambiguous.new("Ambiguous match, found #{size} elements matching #{@query.description}")
end
end