class RSpec::Support::BlockSignature

Deals with the slightly different semantics of block arguments. For methods, arguments are required unless a default value is provided. For blocks, arguments are optional, even if no default value is provided.

However, we want to treat block args as required since you virtually always want to pass a value for each received argument and our ‘and_yield` has treated block args as required for many years.

@api private

Public Instance Methods

classify_parameters() click to toggle source
# File lib/rspec/support/method_signature_verifier.rb, line 268
def classify_parameters
  super
  @min_non_kw_args = @max_non_kw_args unless @max_non_kw_args == INFINITY
end