Add test for fix, fix test for range_matcher

This commit is contained in:
Davide Paolo Tua 2020-02-21 13:19:27 +01:00
parent ce9bf918c1
commit 83ac420273
2 changed files with 20 additions and 2 deletions

View file

@ -13,13 +13,14 @@ module Spectator::Matchers
# Returns a new matcher, with the same bounds, but uses an inclusive range.
def inclusive
new_range = Range.new(range.begin, range.end, exclusive: false)
expected = TestValue.new(new_range, label)
label = expected.label
new_range = Range.new(range.begin, label)
RangeMatcher.new(expected)
end
# Returns a new matcher, with the same bounds, but uses an exclusive range.
def exclusive
label = expected.label
new_range = Range.new(range.begin, range.end, exclusive: true)
expected = TestValue.new(new_range, label)
RangeMatcher.new(expected)