Skip to content

Commit

Permalink
TESTBOX-393 #resolve
Browse files Browse the repository at this point in the history
New environment helpers to do skip detections or anything you see fit: isAdobe, isLucee, isBoxLang, isWindows, isMac, isLinux
  • Loading branch information
lmajano committed Sep 5, 2024
1 parent 5e93c92 commit 12deff9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
4 changes: 2 additions & 2 deletions system/Assertion.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ component {
}

/**
* Skip Test
* Skip a Test
*
* @message The message to send in the skip
* @message The message to send in the skip information dialog
* @detail The detail to add in the exception
*/
function skip( message = "", detail = "" ){
Expand Down
33 changes: 32 additions & 1 deletion system/BaseSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ component {
/**
* Skip a test
*
* @facade
* @message The message to send in the skip information dialog
* @detail The detail to add in the exception
*/
function skip( message = "", detail = "" ){
this.$assert.skip( argumentCollection = arguments );
Expand Down Expand Up @@ -1707,4 +1708,34 @@ component {
return results;
}

/**
* ------------------------------------------------------------------
* Environment Skipping Helpers
* ------------------------------------------------------------------
*/

function isAdobe(){
return server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase( "ColdFusion Server" );
}

function isLucee(){
return server.keyExists( "lucee" );
}

function isBoxLang(){
return server.keyExists( "boxlang" );
}

function isWindows(){
return server.keyExists( "os" ) && server.os.name.findNoCase( "windows" );
}

function isLinux(){
return server.keyExists( "os" ) && server.os.name.findNoCase( "unix" );
}

function isMac(){
return server.keyExists( "os" ) && server.os.name.findNoCase( "mac" );
}

}
5 changes: 4 additions & 1 deletion tests/specs/BaseAssertionsTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ component labels="lucee,cf" extends="testbox.system.BaseSpec" {
);
}

function testIsEqualQuery(){
/**
* Skipped until BoxLang supports query of queries
*/
function testIsEqualQuery() skip="isBoxLang"{
var a = "";
var b = "";
var testQuery = queryNew( "column_a,column_b" );
Expand Down

0 comments on commit 12deff9

Please sign in to comment.