Module: Stannum::RSpec::Matchers

Defined in:
lib/stannum/rspec/match_errors.rb,
lib/stannum/rspec/validate_parameter.rb

Overview

Namespace for custom RSpec matcher macros.

Instance Method Summary collapse

Instance Method Details

#match_errors(expected) ⇒ Stannum::RSpec::MatchErrorsMatcher

Builds a MatchErrorsMatcher.

Parameters:

Returns:



13
14
15
# 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) ⇒ Stannum::RSpec::ValidateParameterMatcher

Builds a ValidateParameterMatcher.

Parameters:

  • method_name (String, Symbol)

    The name of the method with validated parameters.

  • parameter_name (String, Symbol)

    The name of the validated method parameter.

Returns:



16
17
18
19
20
21
# 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