Class: Sinclair::Matchers::Base Abstract Private
- Inherits:
-
RSpec::Matchers::BuiltIn::BaseMatcher
- Object
- RSpec::Matchers::BuiltIn::BaseMatcher
- Sinclair::Matchers::Base
- Defined in:
- lib/sinclair/matchers/base.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 all matchers
Direct Known Subclasses
Instance Method Summary collapse
-
#equal?(other) ⇒ Boolean
(also: #==)
private
Checkes if another instnce is equal self.
-
#initialize(method_name) ⇒ Base
constructor
private
A new instance of Base.
-
#supports_block_expectations? ⇒ Boolean
private
definition needed for block matchers.
Constructor Details
#initialize(method_name) ⇒ Base
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 Base.
11 12 13 14 |
# File 'lib/sinclair/matchers/base.rb', line 11 def initialize(method_name) super @method_name = method_name.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 31 |
# File 'lib/sinclair/matchers/base.rb', line 26 def equal?(other) return false unless other.class == self.class other.method_name == method_name && other.try(:klass) == try(:klass) 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/base.rb', line 19 def supports_block_expectations? true end |