class RSpec::Matchers::BuiltIn::Cover

@api private Provides the implementation for ‘cover`. Not intended to be instantiated directly.

Public Class Methods

new(*expected) click to toggle source
# File lib/rspec/matchers/built_in/cover.rb, line 8
def initialize(*expected)
  @expected = expected
end

Public Instance Methods

does_not_match?(range) click to toggle source
# File lib/rspec/matchers/built_in/cover.rb, line 17
def does_not_match?(range)
  @actual = range
  expected.none? { |e| range.cover?(e) }
end
matches?(range) click to toggle source
# File lib/rspec/matchers/built_in/cover.rb, line 12
def matches?(range)
  @actual = range
  @expected.all? { |e| range.cover?(e) }
end