Use size instead of count

This commit is contained in:
Ivan Neverov 2012-08-08 18:02:48 -05:00
parent 3d158a0dc0
commit 4824afae6c
1 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ module Capybara
end
def find!
raise find_error if @result.count != 1
raise find_error if @result.size != 1
@result.first
end
@ -31,9 +31,9 @@ module Capybara
alias_method :count, :size
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