Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Feb 27, 2020
2 parents 18e5ebf + cf0a9eb commit 6a73ae2
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 73 deletions.
110 changes: 58 additions & 52 deletions .cfformat.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
{
"array.empty_padding" : false,
"array.padding" : true,
"array.multiline.min_length" : 40,
"array.multiline.element_count" : 4,
"array.multiline.leading_comma.padding" : true,
"array.multiline.leading_comma" : false,
"assignments.consecutive.alignment" : true,
"brackets.padding" : true,
"comment.asterisks" : "align",
"binary_operators.padding" : true,
"for_loop_semicolons.padding" : true,
"function_call.empty_padding" : false,
"function_call.padding" : true,
"function_call.multiline.leading_comma.padding" : true,
"function_call.casing.builtin" : "cfdocs",
"function_call.casing.userdefined" : "",
"function_call.multiline.element_count" : 4,
"function_call.multiline.leading_comma" : false,
"function_call.multiline.min_length" : 40,
"function_declaration.padding" : true,
"function_declaration.empty_padding" : false,
"function_declaration.multiline.leading_comma" : false,
"function_declaration.multiline.leading_comma.padding" : true,
"function_declaration.multiline.element_count" : 4,
"function_declaration.multiline.min_length" : 40,
"function_declaration.group_to_block_spacing" : "compact",
"function_anonymous.empty_padding" : false,
"function_anonymous.group_to_block_spacing" : "compact",
"function_anonymous.multiline.element_count" : 4,
"function_anonymous.multiline.leading_comma" : false,
"function_anonymous.multiline.leading_comma.padding" : true,
"function_anonymous.multiline.min_length" : 40,
"function_anonymous.padding" : true,
"indent_size" : 4,
"keywords.block_to_keyword_spacing" : "spaced",
"keywords.group_to_block_spacing" : "spaced",
"keywords.padding_inside_group" : true,
"keywords.spacing_to_block" : "spaced",
"keywords.spacing_to_group" : true,
"keywords.empty_group_spacing" : false,
"max_columns" : 120,
"parentheses.padding" : true,
"strings.quote" : "double",
"strings.attributes.quote" : "double",
"struct.separator" : " : ",
"struct.padding" : true,
"struct.empty_padding" : false,
"struct.multiline.leading_comma" : false,
"struct.multiline.leading_comma.padding" : true,
"struct.multiline.element_count" : 4,
"struct.multiline.min_length" : 40,
"tab_indent" : true
"array.empty_padding": false,
"array.padding": true,
"array.multiline.min_length": 40,
"array.multiline.element_count": 2,
"array.multiline.leading_comma.padding": true,
"array.multiline.leading_comma": false,
"alignment.consecutive.assignments": true,
"alignment.consecutive.properties": true,
"alignment.consecutive.params": true,
"brackets.padding": true,
"comment.asterisks": "align",
"binary_operators.padding": true,
"for_loop_semicolons.padding": true,
"function_call.empty_padding": false,
"function_call.padding": true,
"function_call.multiline.leading_comma.padding": true,
"function_call.casing.builtin": "cfdocs",
"function_call.casing.userdefined": "camel",
"function_call.multiline.element_count": 3,
"function_call.multiline.leading_comma": false,
"function_call.multiline.min_length": 40,
"function_declaration.padding": true,
"function_declaration.empty_padding": false,
"function_declaration.multiline.leading_comma": false,
"function_declaration.multiline.leading_comma.padding": true,
"function_declaration.multiline.element_count": 3,
"function_declaration.multiline.min_length": 40,
"function_declaration.group_to_block_spacing": "compact",
"function_anonymous.empty_padding": false,
"function_anonymous.group_to_block_spacing": "compact",
"function_anonymous.multiline.element_count": 3,
"function_anonymous.multiline.leading_comma": false,
"function_anonymous.multiline.leading_comma.padding": true,
"function_anonymous.multiline.min_length": 40,
"function_anonymous.padding": true,
"indent_size": 4,
"keywords.block_to_keyword_spacing": "spaced",
"keywords.group_to_block_spacing": "spaced",
"keywords.padding_inside_group": true,
"keywords.spacing_to_block": "spaced",
"keywords.spacing_to_group": true,
"keywords.empty_group_spacing": false,
"max_columns": 120,
"metadata.multiline.element_count": 3,
"metadata.multiline.min_length": 40,
"property.multiline.element_count": 3,
"property.multiline.min_length": 40,
"parentheses.padding": true,
"strings.quote": "double",
"strings.attributes.quote": "double",
"struct.separator": " : ",
"struct.padding": true,
"struct.empty_padding": false,
"struct.multiline.leading_comma": false,
"struct.multiline.leading_comma.padding": true,
"struct.multiline.element_count": 2,
"struct.multiline.min_length": 40,
"tab_indent": true
}
8 changes: 6 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"TestBox",
"version":"3.1.0",
"version":"3.2.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/testbox/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"slug":"testbox",
Expand Down Expand Up @@ -36,9 +36,13 @@
"watchDelay":"250"
},
"dependencies":{
"cbstreams":"^1.3.0"
"cbstreams":"^1.5.0"
},
"installPaths":{
"cbstreams":"system/modules/cbstreams/"
},
"scripts":{
"format":"cfformat run system/**/*.cfc,test-harness/**/*.cfc,tests/specs/**/*.cfc,*.cfc --overwrite",
"format:check":"cfformat run system/**/*.cfc,test-harness/**/*.cfc,tests/specs/**/*.cfc,*.cfc --check"
}
}
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Official Site
- ColdFusion 11+ (xUnit + BDD)

## TESTBOX INSTALLATION

You can visit the TestBox documentation page to view all of its features and
capabilities. To install TestBox just drop it in your web root as `/testbox` or
create a mapping in your CFML administrator or `Application.cfc` that points to the
Expand All @@ -64,10 +65,11 @@ Bleeding edge builds are updated automatically as code is committed.

********************************************************************************
Copyright Since 2005 by Luis Majano and Ortus Solutions, Corp

www.ortussolutions.com
********************************************************************************
#### HONOR GOES TO GOD ABOVE ALL

### HONOR GOES TO GOD ABOVE ALL

Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.

>"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ:
Expand All @@ -78,4 +80,5 @@ And hope maketh not ashamed; because the love of God is shed abroad in our heart
Holy Ghost which is given unto us. ." Romans 5:5

### THE DAILY BREAD

> "I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12
3 changes: 2 additions & 1 deletion system/Assertion.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ component {
){
fail( arguments.message );
}
return this;
}

/**
Expand All @@ -363,7 +364,7 @@ component {
arguments.key
.listToArray()
.filter( function( thisKey ){
return !structKeyExists( target, arguments.thisKey );
return structKeyExists( target, arguments.thisKey );
} )
.len() > 0
){
Expand Down
17 changes: 10 additions & 7 deletions system/Expectation.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ component accessors="true" {
arguments.missingMethodName = right( arguments.missingMethodName, len( arguments.missingMethodName ) - 3 );
// set isNot pivot on this matcher
this.isNot = true;

// execute the dynamic method
var results = invoke( this, arguments.missingMethodName, arguments.missingMethodArguments );
if ( !isNull( results ) ) {
return results;
}
else {
return;
}
}

// detect toBeTypeOf dynamic shortcuts
Expand All @@ -93,14 +102,8 @@ component accessors="true" {
return toBeTypeOf( type = type, message = message );
}

// execute the dynamic method
var results = invoke( this, arguments.missingMethodName, arguments.missingMethodArguments );
if ( !isNull( results ) ) {
return results;
}

// throw exception
// throw(type="InvalidMethod", message="The dynamic/static method: #arguments.missingMethodName# does not exist in this CFC", detail="Available methods are #structKeyArray( this ).toString()#");
throw(type="InvalidMethod", message="The dynamic/static method: #arguments.missingMethodName# does not exist in this CFC", detail="Available methods are #structKeyArray( this ).toString()#");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion system/TestResult.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ component accessors="true" {
// internal id
variables.resultsID = createUUID();
// TestBox version
variables.version = "3.1.0-snapshot";
variables.version = "@build.version@";
// Global test durations
variables.startTime = getTickCount();
variables.endTime = 0;
Expand Down
4 changes: 2 additions & 2 deletions system/coverage/browser/CodeBrowser.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ component accessors = true {
* @coverageTresholds Options for threshold
*/
function init( required struct coverageTresholds ) {
variables.streamBuilder = new testbox.system.modules.cbStreams.models.StreamBuilder();
variables.streamBuilder = new testbox.system.modules.cbstreams.models.StreamBuilder();
variables.coverageTresholds = arguments.coverageTresholds;

return this;
Expand Down Expand Up @@ -119,4 +119,4 @@ component accessors = true {
}
}

}
}
5 changes: 5 additions & 0 deletions system/coverage/data/CoverageGenerator.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ component accessors=true {
covered = previousLineRan;
}

// Count as covered any closing parenthesis where the previous line ran.
if( !covered && previousLineRan && ( trim( line ) == ');' || trim( line ) == ')' ) ) {
covered = previousLineRan;
}

// Count as covered any cffunction or cfargument tag where the previous line ran.
if( !covered && reFindNoCase( '^<cf(function|argument)', trim( line) ) && previousLineRan ) {
covered = previousLineRan;
Expand Down
16 changes: 10 additions & 6 deletions system/reports/assets/simple.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ code {
<div>
<pre>#left( local.thisSpec.failDetail, 2500 )#</pre>
</div>
<cfelse>
<cfelseif structKeyExists( local.thisSpec.failOrigin[ 1 ], "raw_trace" )>
<!--- Raw Trace --->
<div>
<pre>#local.thisSpec.failOrigin[ 1 ].raw_trace#</pre>
Expand All @@ -551,10 +551,14 @@ code {
<!--- Deep Insights into failures --->
<div id="failure_error_#local.thisSpec.id#" class="my-2 collapse" data-specid="#local.thisSpec.id#">
<cfdump var="#local.thisSpec.failorigin#" label="Failure Origin">
<cfdump var="#[ local.thisSpec.failDetail ]#" label="Failure Details">
<cfdump var="#[ local.thisSpec.failStackTrace ]#" label="Failure StackTrace">
<cfdump var="#[ local.thisSpec.failExtendedInfo ]#" label="Failure Extended Info">
<h4>Failure Origin</h4>
<cfdump var="#local.thisSpec.failorigin#">
<h4>Failure Details</h4>
<cfdump var="#local.thisSpec.failDetail#">
<h4>Failure StackTrace</h4>
<pre>#local.thisSpec.failStackTrace#</pre>
<h4>Failure Extended Info</h4>
<cfdump var="#local.thisSpec.failExtendedInfo#">
</div>
</div>
</cfif>
Expand All @@ -571,4 +575,4 @@ code {
</cfoutput>
</cfsavecontent>
<cfreturn local.report>
</cffunction>
</cffunction>
12 changes: 12 additions & 0 deletions tests/specs/EdgeCases.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ component extends="testbox.system.BaseSpec" {
}
});

describe( "When testing a key does not exists", function(){
var data = {name="luis", awesome=true};
it( "should pass when the key does not exist", function(){
expect( data ).notToHaveKey( "age" );
});
it( "should fail when the key does exist", function(){
expect( function(){
expect( data ).notToHaveKey( "name" );
} ).toThrow( type = "TestBox.AssertionFailed" );
});
});

}

private function myFakeClosure(){
Expand Down

0 comments on commit 6a73ae2

Please sign in to comment.