Sha256: 5736bd9548172b2fa7a4525d687b22f0130483fd4cc0b895861041b7c4305e96

Contents?: true

Size: 736 Bytes

Versions: 7

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true
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

7 entries across 7 versions & 3 rubygems

Version Path
tdiary-5.0.2 vendor/bundle/gems/capybara-2.8.0/lib/capybara/queries/base_query.rb
capybara-2.8.1 lib/capybara/queries/base_query.rb
capybara-2.8.0 lib/capybara/queries/base_query.rb
tdiary-5.0.1 vendor/bundle/gems/capybara-2.7.1/lib/capybara/queries/base_query.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/capybara-2.7.1/lib/capybara/queries/base_query.rb
capybara-2.7.1 lib/capybara/queries/base_query.rb
capybara-2.7.0 lib/capybara/queries/base_query.rb