class RouteMechanic::RSpec::Matchers::BaseMatcher
Public Class Methods
new(expected)
click to toggle source
@param [Rails::Application] expected
# File lib/route_mechanic/rspec/matchers/base_matcher.rb, line 12 def initialize(expected) @expected = expected end
Public Instance Methods
description()
click to toggle source
# File lib/route_mechanic/rspec/matchers/base_matcher.rb, line 24 def description raise NotImplementedError end
failure_message()
click to toggle source
# File lib/route_mechanic/rspec/matchers/base_matcher.rb, line 20 def failure_message @rescued_exception.message end
matches?(_actual)
click to toggle source
# File lib/route_mechanic/rspec/matchers/base_matcher.rb, line 16 def matches?(_actual) raise NotImplementedError end
Private Instance Methods
match_unless_raises(*exceptions) { || ... }
click to toggle source
# File lib/route_mechanic/rspec/matchers/base_matcher.rb, line 30 def match_unless_raises(*exceptions) exceptions.unshift Exception if exceptions.empty? begin yield true rescue *exceptions => @rescued_exception false end end