lib/bauxite/core/selector.rb in bauxite-0.4.0 vs lib/bauxite/core/selector.rb in bauxite-0.4.1

- old
+ new

@@ -44,22 +44,16 @@ # end # end # # === end selectors/example.rb === # # def find(selector, &block) - # I know I should be using Class scope operators to refer to class - # methods (i.e. Context::selectors), but for some reason RDoc - # refuses to document the Selector class (below) if any such - # operators appear in this method (quite strange). So for now, I'll - # just settle for using the old and trusty "." - data = selector.split('=', 2) type = data.length == 2 ? data[0] : "default" - raise ArgumentError, "Invalid selector type '#{type}'" unless Context.selectors.include? type + raise ArgumentError, "Invalid selector type '#{type}'" unless Context::selectors.include? type arg = data[-1] - custom_selectors = Context.selectors(false) + custom_selectors = Context::selectors(false) return send(type , arg, &block) if custom_selectors.include? type return send(type+'_selector', arg, &block) if custom_selectors.include? type+'_selector' selenium_find(type, arg, &block) end @@ -147,10 +141,8 @@ # [link=+exactText+ and link_text=+exactText+] {Locate A elements whose text is exactly +exactText+.}[http://docs.seleniumhq.org/docs/03_webdriver.jsp#by-link-text] # [tag_name=+targetValue+] {Locate elements whose tag name matches +targetValue+.}[http://docs.seleniumhq.org/docs/03_webdriver.jsp#by-tag-name] # [xpath=+xpathExpression+] {Locate elements using XPATH expressions.}[http://docs.seleniumhq.org/docs/03_webdriver.jsp#by-xpath] # class Selector - include SelectorModule - - # :section: Selector Methods + include Bauxite::SelectorModule end end \ No newline at end of file