Skip to content

Commit

Permalink
Improve class coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Jun 13, 2018
1 parent 3812c9a commit 35ad1ab
Showing 1 changed file with 27 additions and 0 deletions.
@@ -0,0 +1,27 @@
package net.fortuna.ical4j.filter

import net.fortuna.ical4j.model.DateRange
import spock.lang.Shared
import spock.lang.Specification

class DateInRangeRuleTest extends Specification {

@Shared def rangeFrom = Calendar.instance
@Shared def rangeTo = Calendar.instance

def setupSpec() {
rangeTo.add(Calendar.DAY_OF_MONTH, 7)
}

def 'assert rule match'() {
given: 'a date range rule'
DateInRangeRule rule = [range, DateRange.INCLUSIVE_START | DateRange.INCLUSIVE_END]

expect:
rule.test(date) == test

where:
range | date | test
new DateRange(rangeFrom.getTime(), rangeTo.getTime()) | new Date() | true
}
}

0 comments on commit 35ad1ab

Please sign in to comment.