BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

expectException() doesn't work on certain use cases.

Description

Repro:

function testExpectException_fail_no_exception_raised(){ expectException("MyException"); } function testRaiseException_pass(){ expectException("MyException"); raiseExpectedException(); } function testRaiseException_fail_wrong_exception_raised(){ expectException("MyException"); raiseExpectedException(); } function raiseExpectedException(){ throw(type="MyException"); } function raiseUnexpectedException(){ throw(type="DifferentException"); }

Results:

testRaiseException_pass

Fails due to exception bubbling back to calling code

testRaiseException_fail_wrong_exception_raised

Fails due to exception bubbling back to calling code

testExpectException_fail_no_exception_raised

Incorrectly passes: an exception was expected but none is raised

Gliffy Diagrams

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Priority

Sentry

Created January 21, 2014 at 8:01 AM
Updated January 21, 2014 at 6:50 PM
Resolved January 21, 2014 at 6:50 PM

Flag notifications