I am brand new to Spock and perused their online docs. I have a test case where I need to verify that my fixture's interaction with a non-mock collaborator does not produce an exception:
class FizzSpec extends Specification {
def "no exception thrown when we hail buzz"() {
given:
Fizz fixture = new Fizz()
Buzz buzz = new Buzz("YES", true, "Garble barb") // A non-mock!
when:
fixture.hail(buzz)
// TODO: How to verify the hail didn't produce an exception?
// then:
// thrown() == null
}
}
Any ideas as to how I can accomplish this?
notThrown(NullPointerException)
– Berard