Merge pull request #828 from exviva/actually_memoize

Actually memoize the attributes of a Selenium node
This commit is contained in:
Jonas Nicklas 2012-09-19 02:20:31 -07:00
commit 888d1b9d36
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
end
def [](name)
@attrs = {}
@attrs ||= {}
@attrs[name] ||= native.attribute(name.to_s)
rescue Selenium::WebDriver::Error::WebDriverError
nil