module Stannum::RSpec::Matchers

Namespace for custom RSpec matcher macros.

Namespace for custom RSpec matcher macros.

Public Instance Methods

match_errors(expected) click to toggle source

Builds a MatchErrorsMatcher.

@param expected [Stannum::Errors] The expected errors.

@return [Stannum::RSpec::MatchErrorsMatcher] the matcher.

# File lib/stannum/rspec/match_errors.rb, line 13
def match_errors(expected)
  Stannum::RSpec::MatchErrorsMatcher.new(expected)
end
validate_parameter(method_name, parameter_name) click to toggle source

Builds a ValidateParameterMatcher.

@param method_name [String, Symbol] The name of the method with validated

parameters.

@param parameter_name [String, Symbol] The name of the validated method

parameter.

@return [Stannum::RSpec::ValidateParameterMatcher] the matcher.

# File lib/stannum/rspec/validate_parameter.rb, line 16
def validate_parameter(method_name, parameter_name)
  Stannum::RSpec::ValidateParameterMatcher.new(
    method_name:    method_name,
    parameter_name: parameter_name
  )
end