From 4824afae6cee72c9801696f80aecedc60b26bc39 Mon Sep 17 00:00:00 2001 From: Ivan Neverov Date: Wed, 8 Aug 2012 18:02:48 -0500 Subject: [PATCH] Use size instead of count --- lib/capybara/result.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/capybara/result.rb b/lib/capybara/result.rb index bda27a87..a234bc56 100644 --- a/lib/capybara/result.rb +++ b/lib/capybara/result.rb @@ -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