Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Test.dies

$t.dies($anonFunction, $description) -> self

Description

Runs an anonymous function and return true if it throws an exception. Otherwise it returns false.

$t = Test()

// Test passes (returns true)
$badFun = fun { Bear.fly() }
$t.dies($badFun, 'Bears don`t fly')

See Also