push
github
0 of 2 new or added lines in 1 file covered. (0.0%)
1930 existing lines in 59 files now uncovered.0 of 2023 relevant lines covered (0.0%)
0.0 hits per line
UNCOV
1
|
module Unleash |
× |
UNCOV
2
|
module ConstraintMatcher |
× |
UNCOV
3
|
class DateConstraint |
× |
UNCOV
4
|
OPERATORS = [
|
× |
5 |
'DATE_AFTER',
|
|
6 |
'DATE_BEFORE'
|
|
7 |
].freeze |
|
8 |
|
|
UNCOV
9
|
def self.matches?(operator, context_value, constraint_value) |
× |
UNCOV
10
|
begin
|
× |
UNCOV
11
|
context_value = DateTime.parse(context_value)
|
× |
UNCOV
12
|
constraint_value = DateTime.parse(constraint_value)
|
× |
13 |
rescue ArgumentError |
|
14 |
false
|
× |
15 |
end
|
|
16 |
|
|
UNCOV
17
|
case operator
|
× |
18 |
when "DATE_AFTER" |
|
UNCOV
19
|
constraint_value < context_value |
× |
20 |
when "DATE_BEFORE" |
|
UNCOV
21
|
constraint_value > context_value |
× |
22 |
end
|
|
23 |
end
|
|
24 |
|
|
UNCOV
25
|
def self.include?(operator) |
× |
UNCOV
26
|
OPERATORS.include? operator
|
× |
27 |
end
|
|
28 |
end
|
|
29 |
end
|
|
30 |
end
|