Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
raise ArgumentError if more specifiers are used with :xpath
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmo committed Feb 28, 2012
1 parent 9b1598e commit b22711c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion watir/lib/watir/supported_elements.rb
Expand Up @@ -34,7 +34,7 @@ def #{args.delete(:plural) || method_name.to_s + "s"}(how={}, what=nil)
def format_specifiers(tag_name, how, what)
defaults = {:tag_name => [tag_name].flatten.map(&:to_s)}
formatted_specifiers = defaults.merge(what ? {how => what} : how)
if formatted_specifiers[:xpath] && formatted_specifiers.size > 1
if formatted_specifiers[:xpath] && formatted_specifiers.size > 2
raise ArgumentError, ":xpath specifier should be the only one when used in #{formatted_specifiers.inspect}"
end
formatted_specifiers
Expand Down

0 comments on commit b22711c

Please sign in to comment.