Skip to content

Commit e80502b

Browse files
Fixing TryTest
1 parent 0767e27 commit e80502b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test/groovy/edu/ie3/datamodel/utils/TryTest.groovy

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ class TryTest extends Specification {
112112

113113
def "A Try object can be creates by a boolean and an exception"() {
114114
when:
115-
def actual = Try.ofVoid(bool, ex)
115+
def ex = new FailureException("failure")
116+
def actual = Try.ofVoid(bool, () -> ex)
116117

117118
then:
118119
actual.failure == expected
@@ -122,9 +123,9 @@ class TryTest extends Specification {
122123
}
123124

124125
where:
125-
bool | ex | expected
126-
true | new FailureException("failure") | true
127-
false | new FailureException("no failure") | false
126+
bool || expected
127+
true || true
128+
false || false
128129
}
129130

130131
def "A list of Tries is returned when applying a multiple VoidSupplier to Try#ofVoid()"() {

0 commit comments

Comments
 (0)