Class: RSpec::Support::LooseSignatureVerifier::SignatureWithKeywordArgumentsMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/support/method_signature_verifier.rb

Overview

If a matcher is used in a signature in place of keyword arguments, all keyword argument validation needs to be skipped since the matcher is opaque.

Instead, keyword arguments will be validated when the method is called and they are actually known.

Instance Method Summary collapse

Constructor Details

#initialize(signature) ⇒ SignatureWithKeywordArgumentsMatcher

Returns a new instance of SignatureWithKeywordArgumentsMatcher.



242
243
244
# File 'lib/rspec/support/method_signature_verifier.rb', line 242

def initialize(signature)
  @signature = signature
end

Instance Method Details

#has_kw_args_in?(args) ⇒ Boolean

Returns:

  • (Boolean)


262
263
264
# File 'lib/rspec/support/method_signature_verifier.rb', line 262

def has_kw_args_in?(args)
  @signature.has_kw_args_in?(args)
end

#invalid_kw_args_from(_kw_args) ⇒ Object



250
251
252
# File 'lib/rspec/support/method_signature_verifier.rb', line 250

def invalid_kw_args_from(_kw_args)
  []
end

#missing_kw_args_from(_kw_args) ⇒ Object



246
247
248
# File 'lib/rspec/support/method_signature_verifier.rb', line 246

def missing_kw_args_from(_kw_args)
  []
end

#non_kw_args_arity_descriptionObject



254
255
256
# File 'lib/rspec/support/method_signature_verifier.rb', line 254

def non_kw_args_arity_description
  @signature.non_kw_args_arity_description
end

#valid_non_kw_args?(*args) ⇒ Boolean

Returns:

  • (Boolean)


258
259
260
# File 'lib/rspec/support/method_signature_verifier.rb', line 258

def valid_non_kw_args?(*args)
  @signature.valid_non_kw_args?(*args)
end