Sha256: 5194c63a8919b60b59bcd0d0f6592752b6bfe5d83cbfbdfd38234c5ecd85e274

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

module Capybara
  # @api private
  module Queries
    class BaseQuery
      COUNT_KEYS = [:count, :minimum, :maximum, :between]

      attr_reader :options

      def wait
        if @options.has_key?(:wait)
          @options[:wait] || 0
        else
          Capybara.default_max_wait_time
        end
      end

      private

      def assert_valid_keys
        invalid_keys = @options.keys - valid_keys
        unless invalid_keys.empty?
          invalid_names = invalid_keys.map(&:inspect).join(", ")
          valid_names = valid_keys.map(&:inspect).join(", ")
          raise ArgumentError, "invalid keys #{invalid_names}, should be one of #{valid_names}"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capybara-2.6.2 lib/capybara/queries/base_query.rb
capybara-2.6.1 lib/capybara/queries/base_query.rb
capybara-2.6.0 lib/capybara/queries/base_query.rb
capybara-2.5.0 lib/capybara/queries/base_query.rb