class RSpec::Support::MethodSignatureExpectation
@api private
allowed/required keyword args of a given method.
Encapsulates expectations about the number of arguments and
def empty?
def empty? @min_count.nil? && @keywords.to_a.empty? && !@expect_arbitrary_keywords && !@expect_unlimited_arguments end
def initialize
def initialize @min_count = nil @max_count = nil @keywords = [] @expect_unlimited_arguments = false @expect_arbitrary_keywords = false end
def keywords=(values)
def keywords=(values) @keywords = values.to_a || [] end
def max_count=(number)
def max_count=(number) raise ArgumentError, 'must be a non-negative integer or nil' \ unless number.nil? || (number.is_a?(Integer) && number >= 0) @max_count = number end
def min_count=(number)
def min_count=(number) raise ArgumentError, 'must be a non-negative integer or nil' \ unless number.nil? || (number.is_a?(Integer) && number >= 0) @min_count = number end