Class: RSpec::Matchers::BuiltIn::Cover Private
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::Cover
- Defined in:
- lib/rspec/matchers/built_in/cover.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.
Provides the implementation for cover
.
Not intended to be instantiated directly.
Constant Summary
Constant Summary
Constants inherited from BaseMatcher
Instance Method Summary (collapse)
- - (Boolean) does_not_match?(range) private
-
- (Cover) initialize(*expected)
constructor
private
A new instance of Cover.
- - (Boolean) matches?(range) private
Methods inherited from BaseMatcher
#description, #diffable?, #failure_message, #failure_message_when_negated, #match_unless_raises, #supports_block_expectations?
Methods included from Composable
#===, #and, #description_of, enumerable?, #or, surface_descriptions_in, #values_match?
Methods included from Pretty
#name, split_words, #to_sentence, #to_word
Constructor Details
- (Cover) initialize(*expected)
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 Cover
8 9 10 |
# File 'lib/rspec/matchers/built_in/cover.rb', line 8 def initialize(*expected) @expected = expected end |
Instance Method Details
- (Boolean) does_not_match?(range)
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.
17 18 19 20 |
# File 'lib/rspec/matchers/built_in/cover.rb', line 17 def does_not_match?(range) @actual = range expected.none? { |e| range.cover?(e) } end |
- (Boolean) matches?(range)
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.
12 13 14 15 |
# File 'lib/rspec/matchers/built_in/cover.rb', line 12 def matches?(range) @actual = range @expected.all? { |e| range.cover?(e) } end |