Class: Sinclair::Matchers::AddMethod Abstract Private
- Inherits:
-
RSpec::Matchers::BuiltIn::BaseMatcher
- Object
- RSpec::Matchers::BuiltIn::BaseMatcher
- Sinclair::Matchers::AddMethod
- Defined in:
- lib/sinclair/matchers/add_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.
Base class for add_method matcher
Direct Known Subclasses
Instance Method Summary collapse
-
#equal?(other) ⇒ Boolean
(also: #==)
private
Checkes if another instnce is equal self.
-
#initialize(method) ⇒ AddMethod
constructor
private
A new instance of AddMethod.
-
#supports_block_expectations? ⇒ Boolean
private
definition needed for block matchers.
Constructor Details
#initialize(method) ⇒ AddMethod
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.
Returns a new instance of AddMethod.
12 13 14 |
# File 'lib/sinclair/matchers/add_method.rb', line 12 def initialize(method) @method = method.to_sym end |
Instance Method Details
#equal?(other) ⇒ Boolean Also known as: ==
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.
Checkes if another instnce is equal self
26 27 28 29 30 |
# File 'lib/sinclair/matchers/add_method.rb', line 26 def equal?(other) return unless other.class == self.class other.method == method end |
#supports_block_expectations? ⇒ 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.
definition needed for block matchers
19 20 21 |
# File 'lib/sinclair/matchers/add_method.rb', line 19 def supports_block_expectations? true end |