Permalink
Browse files

Add guard to Watir.index_base ensure it is zero or one.

  • Loading branch information...
1 parent a9bcdec commit 4d929bb787e7916c0d543637c478b5991bfdefc3 @bret bret committed Oct 27, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 commonwatir/lib/watir/index_base.rb
@@ -6,6 +6,7 @@ def index_base
end
# Set the origin for :index. Values 0 or 1 are supported.
def index_base= integer
+ raise ArgumentError, 'index_base must be 0 or 1' unless [0, 1].include? integer
@@index_base = integer
end
end

0 comments on commit 4d929bb

Please sign in to comment.