Skip to content
Browse files

Merge pull request #828 from exviva/actually_memoize

Actually memoize the attributes of a Selenium node
  • Loading branch information...
2 parents 2c57735 + 1d8a0ef commit 888d1b9d364c070d6a9a0c0e05dbeeb7471c5d8b @jnicklas committed Sep 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/capybara/selenium/node.rb
View
2 lib/capybara/selenium/node.rb
@@ -5,7 +5,7 @@ def text
end
def [](name)
- @attrs = {}
+ @attrs ||= {}
@attrs[name] ||= native.attribute(name.to_s)
rescue Selenium::WebDriver::Error::WebDriverError
nil

0 comments on commit 888d1b9

Please sign in to comment.
Something went wrong with that request. Please try again.