Class: RSpec::Support::StrictSignatureVerifier

### Home Classes Methods

### In Files

- lib/rspec/support/method_signature_verifier.rb

### Parent

Object

### Methods

- ::new
- #error_message
- #valid?

### Class/Module Index

Quicksearch

- RSpec
- RSpec::CallerFilter
- RSpec::Support
- RSpec::Support::BlockSignature
- RSpec::Support::Differ
- RSpec::Support::DirectoryMaker
- RSpec::Support::EncodedString
- RSpec::Support::FormattingSupport
- RSpec::Support::FuzzyMatcher
- RSpec::Support::HunkGenerator
- RSpec::Support::InSubProcess
- RSpec::Support::LooseSignatureVerifier
- RSpec::Support::LooseSignatureVerifier::SignatureWithKeywordArgumentsMatcher
- RSpec::Support::MethodSignature
- RSpec::Support::MethodSignatureVerifier
- RSpec::Support::OS
- RSpec::Support::ObjectFormatter
- RSpec::Support::RecursiveConstMethods
- RSpec::Support::Ruby
- RSpec::Support::RubyFeatures
- RSpec::Support::ShellOut
- RSpec::Support::Spec
- RSpec::Support::StdErrSplitter
- RSpec::Support::StrictSignatureVerifier
- RSpec::Support::Version
- RSpec::Support::VersionChecker
- RSpec::Support::Warnings
- RSpec::Support::WithIsolatedStdErr
- Object
- RSpecHelpers

No matching classes.

# RSpec::Support::StrictSignatureVerifier

Abstract base class for signature verifiers.

@api private

### Attributes

kw_args[R]
non_kw_args[R]

### Public Class Methods

new(signature, args) click to toggle source

    # File lib/rspec/support/method_signature_verifier.rb, line 163
    def initialize(signature, args)
      @signature = signature
      @non_kw_args, @kw_args = split_args(*args)
    end

### Public Instance Methods

error_message() click to toggle source

    # File lib/rspec/support/method_signature_verifier.rb, line 174
    def error_message
      if missing_kw_args.any?
        "Missing required keyword arguments: %s" % [
          missing_kw_args.join(", ")
        ]
      elsif invalid_kw_args.any?
        "Invalid keyword arguments provided: %s" % [
          invalid_kw_args.join(", ")
        ]
      elsif !valid_non_kw_args?
        "Wrong number of arguments. Expected %s, got %s." % [
          @signature.non_kw_args_arity_description,
          non_kw_args.length
        ]
      end
    end

valid?() click to toggle source

    # File lib/rspec/support/method_signature_verifier.rb, line 168
    def valid?
      missing_kw_args.empty? &&
        invalid_kw_args.empty? &&
        valid_non_kw_args?
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.