Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed May 27, 2020
2 parents 1d01daa + 8642666 commit 620650c
Show file tree
Hide file tree
Showing 56 changed files with 1,231 additions and 515 deletions.
7 changes: 4 additions & 3 deletions .cfformat.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
"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.element_count": 2,
"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.element_count": 2,
"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.element_count": 2,
"function_anonymous.multiline.leading_comma": false,
"function_anonymous.multiline.leading_comma.padding": true,
"function_anonymous.multiline.min_length": 40,
Expand All @@ -44,6 +44,7 @@
"max_columns": 120,
"metadata.multiline.element_count": 3,
"metadata.multiline.min_length": 40,
"method_call.chain.multiline" : 3,
"newline":"\n",
"property.multiline.element_count": 3,
"property.multiline.min_length": 40,
Expand Down
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ install:
script:
# Set Current Version
- TARGET_VERSION=`cat $TRAVIS_BUILD_DIR/box.json | jq '.version' -r`
- TRAVIS_TAG=${TARGET_VERSION}
- echo "Starting build TestBox v${TARGET_VERSION}"
# Replace version so builder can issue it
- box package set [email protected]@[email protected]@
Expand Down Expand Up @@ -86,6 +87,22 @@ deploy:
upload-dir: testbox/$TARGET_VERSION
acl: public_read

# Github Release only on Master
- provider: releases
api_key: ${GITHUB_TOKEN}
on:
branch:
- master
condition: "$ENGINE = lucee@5"
skip_cleanup: true
edge: true
file_glob: true
file: $TRAVIS_BUILD_DIR/artifacts/testbox/**/*
release_notes_file: changelog.md
name: v${TRAVIS_TAG}
tag_name: v${TRAVIS_TAG}
overwrite: true

after_deploy:
- cd $TRAVIS_BUILD_DIR/build-testbox/testbox
- if [ ${ENGINE} = 'lucee@5' ]; then box forgebox publish; fi
7 changes: 4 additions & 3 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"TestBox",
"version":"4.0.0",
"version":"4.1.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/testbox/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"slug":"testbox",
Expand Down Expand Up @@ -44,9 +44,10 @@
"mockdatacfc":"system/modules/mockdatacfc/"
},
"scripts":{
"toMaster":"recipe build/toMaster.boxr",
"release":"recipe build/release.boxr",
"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",
"format:check":"cfformat run system/**/*.cfc,test-harness/**/*.cfc,tests/specs/**/*.cfc,*.cfc --check",
"format:watch":"cfformat watch system/**/*.cfc,test-harness/**/*.cfc,tests/specs/**/*.cfc,*.cfc ./.cfformat.json",
"start:lucee":"server start [email protected]",
"start:2016":"server start [email protected]",
"start:2018":"server start [email protected]"
Expand Down
2 changes: 1 addition & 1 deletion build/toMaster.boxr → build/release.boxr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Check out master
!git checkout -f master
!git pull
!git pull origin master
# Merge development into it
!git merge --no-ff development
# Tag the master repo with the version in box.json
Expand Down
22 changes: 22 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

----

## [4.1.0] => 2020-MAY-27

### Fixed

* [TESTBOX-283] - Fix type on test results for bundlestats
* [TESTBOX-286] - `DebugBuffer` was being removed instead of resetting to empty for `getMemento`
* [TESTBOX-281] - `request.testbox` Component ... has no accessible Member with name [$TESTID]

### Added

* [TESTBOX-282] - Added cfml engine and version as part of the test results as properties
* [TESTBOX-284] - Update all reporters so they can just build and return the report with no content type or context repsonse resets
* [TESTBOX-285] - make `buildReporter` public in the testbox core
68 changes: 55 additions & 13 deletions system/Assertion.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@ component {
* @expression The expression to test
* @message The message to send in the failure
*/
function assert( required boolean expression, message = "" ){
return isTrue( arguments.expression, arguments.message );
function assert(
required boolean expression,
message = ""
){
return isTrue(
arguments.expression,
arguments.message
);
}

/**
* Assert something is true
* @actual The actual data to test
* @message The message to send in the failure
*/
function isTrue( required boolean actual, message = "" ){
function isTrue(
required boolean actual,
message = ""
){
arguments.message = ( len( arguments.message ) ? arguments.message : "Expected [#arguments.actual#] to be true" );
if ( NOT arguments.actual ) {
fail( arguments.message );
Expand All @@ -48,7 +57,10 @@ component {
* @actual The actual data to test
* @message The message to send in the failure
*/
function isFalse( required boolean actual, message = "" ){
function isFalse(
required boolean actual,
message = ""
){
arguments.message = ( len( arguments.message ) ? arguments.message : "Expected [#arguments.actual#] to be false" );
if ( arguments.actual ) {
fail( arguments.message );
Expand Down Expand Up @@ -688,7 +700,12 @@ component {
return this;
}
} else if ( isDate( arguments.actual ) ) {
if ( !listFindNoCase( "yyyy,q,m,ww,w,y,d,h,n,s,l", arguments.datePart ) ) {
if (
!listFindNoCase(
"yyyy,q,m,ww,w,y,d,h,n,s,l",
arguments.datePart
)
) {
fail( "The passed in datepart [#arguments.datepart#] is not valid." );
}

Expand Down Expand Up @@ -1021,8 +1038,14 @@ component {
}

// Get both column lists and sort them the same
var actualColumnList = listSort( arguments.actual.columnList, "textNoCase" );
var expectedColumnList = listSort( arguments.expected.columnList, "textNoCase" );
var actualColumnList = listSort(
arguments.actual.columnList,
"textNoCase"
);
var expectedColumnList = listSort(
arguments.expected.columnList,
"textNoCase"
);

// Check column lists
if ( actualColumnList != expectedColumnList ) {
Expand Down Expand Up @@ -1081,7 +1104,12 @@ component {
return false;
}
// And make sure they match
if ( !equalize( arguments.actual[ i ], arguments.expected[ i ] ) ) {
if (
!equalize(
arguments.actual[ i ],
arguments.expected[ i ]
)
) {
return false;
}
continue;
Expand All @@ -1100,9 +1128,15 @@ component {

// Structs / Object
if ( isStruct( arguments.actual ) && isStruct( arguments.expected ) ) {
var actualKeys = listSort( structKeyList( arguments.actual ), "textNoCase" );
var expectedKeys = listSort( structKeyList( arguments.expected ), "textNoCase" );
var key = "";
var actualKeys = listSort(
structKeyList( arguments.actual ),
"textNoCase"
);
var expectedKeys = listSort(
structKeyList( arguments.expected ),
"textNoCase"
);
var key = "";

// Confirm both structs have the same keys
if ( actualKeys neq expectedKeys ) {
Expand All @@ -1120,7 +1154,12 @@ component {
return false;
}
// And make sure they match when actual values exist
if ( !equalize( arguments.actual[ key ], arguments.expected[ key ] ) ) {
if (
!equalize(
arguments.actual[ key ],
arguments.expected[ key ]
)
) {
return false;
}
}
Expand Down Expand Up @@ -1150,7 +1189,10 @@ component {

if ( listFirst( server.coldfusion.productversion ) lt 10 ) {
if ( isCustomFunction( arguments.target ) ) {
throw( type = "InvalidType", message = "You sent an invalid type for length checking (function)" );
throw(
type = "InvalidType",
message = "You sent an invalid type for length checking (function)"
);
}
} else {
if ( isCustomFunction( arguments.target ) or isClosure( arguments.target ) ) {
Expand Down
Loading

0 comments on commit 620650c

Please sign in to comment.