Class: Sinclair::Matchers::AddInstanceMethod Private
- Inherits:
-
AddMethod
- Object
- RSpec::Matchers::BuiltIn::BaseMatcher
- AddMethod
- Sinclair::Matchers::AddInstanceMethod
- Defined in:
- lib/sinclair/matchers/add_instance_method.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.
AddInstanceMethod is able to build an instance of AddInstanceMethodTo
Instance Method Summary collapse
-
#matches?(_actual) ⇒ Boolean
abstract
private
Raise a warning on the usage as this is only a builder for AddInstanceMethodTo.
-
#to(target = nil) ⇒ AddInstanceMethodTo
private
Creates a matcher AddInstanceMethodTo.
Methods inherited from AddMethod
#equal?, #initialize, #supports_block_expectations?
Constructor Details
This class inherits a constructor from Sinclair::Matchers::AddMethod
Instance Method Details
#matches?(_actual) ⇒ Boolean
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.
Raise a warning on the usage as this is only a builder for Sinclair::Matchers::AddInstanceMethodTo
64 65 66 67 |
# File 'lib/sinclair/matchers/add_instance_method.rb', line 64 def matches?(_actual) raise SyntaxError, 'You should specify which instance the method is being added to' \ "add_method(:#{method}).to(instance)" end |
#to(klass) ⇒ AddInstanceMethodTo #to(instance) ⇒ AddInstanceMethodTo
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.
Creates a matcher AddInstanceMethodTo
80 81 82 |
# File 'lib/sinclair/matchers/add_instance_method.rb', line 80 def to(target = nil) AddInstanceMethodTo.new(target, method) end |