class RSpec::ChangeToNow::Matchers::MatcherOnly

Decorator that wraps a matcher and raises a syntax error if the matcher is not a matcher.

@api private

Public Instance Methods

description(*args) click to toggle source
# File lib/rspec/change_to_now/matchers/matcher_only.rb, line 16
def description(*args)
  base_matcher.description(*args)
end
method_missing(method, *args) click to toggle source

Forward messages on to the wrapped matcher, first verifying that this really is a matcher.

# File lib/rspec/change_to_now/matchers/matcher_only.rb, line 11
def method_missing(method, *args)
  raise SyntaxError, "expected a matcher as an argument but got: #{base_matcher.inspect}" unless Matchers.is_a_matcher?(base_matcher)
  base_matcher.send(method, *args)
end