We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f77f1f2 commit bae6791Copy full SHA for bae6791
CodewarsBaseSpec.cfc
@@ -3,12 +3,21 @@ component extends="testbox.system.BaseSpec" {
3
* @aroundEach
4
*/
5
function captureOutput( spec, suite ){
6
- savecontent variable="local.out" {
7
- arguments.spec.body();
8
- }
9
- if( len( trim( local.out ) ) ) {
10
- debug( local.out )
11
+ var out = '';
+ savecontent variable="local.out" {
+ try{
+ arguments.spec.body();
+ } catch( any e ) {
+ var thisFailure = e;
12
+ }
13
14
+ // make sure we debug any output, even on failure
15
+ if( len( trim( local.out ) ) ) {
16
+ debug( local.out )
17
18
+ if( !isNull( thisFailure ) ) {
19
+ throw( thisFailure );
20
21
}
-
22
+
23
0 commit comments