Class: RSpec::ChangeToNow::Matchers::MatcherOnly Private

Inherits:
Matchers::MatcherDelegator
  • Object
show all
Defined in:
lib/rspec/change_to_now/matchers/matcher_only.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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

Raises:

  • (SyntaxError)


11
12
13
14
# 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

Instance Method Details

#description(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/rspec/change_to_now/matchers/matcher_only.rb', line 16

def description(*args)
  base_matcher.description(*args)
end