Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano authored and github-actions[bot] committed Sep 17, 2024
1 parent 16ba9bf commit d05e0de
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions commands/testbox/create/bdd.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* {code}
*
**/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

/**
* @name Name of the BDD spec to create without the .cfc. For packages, specify name as 'myPackage/myBDDSpec'
Expand All @@ -17,8 +17,8 @@ component extends="testboxCLI.models.BaseCommand"{
**/
function run(
required name,
boolean open = false,
directory = getCWD(),
boolean open = false,
directory = getCWD(),
boolean boxlang = isBoxLangProject( getCWD() )
){
isBoxLangProject();
Expand Down Expand Up @@ -49,7 +49,7 @@ component extends="testboxCLI.models.BaseCommand"{
print.line();

// Read in Templates
var BDDContent = fileRead( "#variables.settings.templatesPath#/#arguments.boxlang ? 'bx' : 'cfml'#/bdd.txt" );
var BDDContent = fileRead( "#variables.settings.templatesPath#/#arguments.boxlang ? "bx" : "cfml"#/bdd.txt" );

// Write out BDD Spec
var BDDPath= "#arguments.directory#/#name#.cfc";
Expand Down
8 changes: 4 additions & 4 deletions commands/testbox/create/unit.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* {code}
*
**/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

/**
* @name Name of the xUnit bundle to create without the .cfc. For packages, specify name as 'myPackage/MyTest'
Expand All @@ -17,8 +17,8 @@
**/
function run(
required name,
boolean open = false,
directory = getCWD(),
boolean open = false,
directory = getCWD(),
boolean boxlang = isBoxLangProject( getCWD() )
){
// Allow dot-delimited paths
Expand Down Expand Up @@ -46,7 +46,7 @@
print.line();

// Read in Templates
var content = fileRead( "#variables.settings.templatesPath#/#arguments.boxlang ? 'bx' : 'cfml'#/unit.txt" );
var content = fileRead( "#variables.settings.templatesPath#/#arguments.boxlang ? "bx" : "cfml"#/unit.txt" );

// Write out BDD Spec
var thisPath= "#arguments.directory#/#name#.cfc";
Expand Down
6 changes: 3 additions & 3 deletions commands/testbox/generate/browser.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
* testbox create browser C:\myApp
* {code}
*/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

/**
* @directory The base directory to create your test browser
* @boxlang Is this a boxlang project? else it is a CFML project
*/
function run(
string directory = getCWD(),
boolean boxlang = isBoxLangProject( getCWD() )
boolean boxlang = isBoxLangProject( getCWD() )
){
// This will make each directory canonical and absolute
arguments.directory = resolvePath( arguments.directory & "/tests/browser" );
Expand All @@ -30,7 +30,7 @@ component extends="testboxCLI.models.BaseCommand"{

// Copy template from testbox source
directoryCopy(
"#variables.settings.templatesPath#/#arguments.boxlang ? 'bx' : 'cfml'#/browser/",
"#variables.settings.templatesPath#/#arguments.boxlang ? "bx" : "cfml"#/browser/",
arguments.directory,
true
);
Expand Down
6 changes: 3 additions & 3 deletions commands/testbox/generate/harness.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
* testbox create harness C:\myApp
* {code}
*/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

/**
* @directory The base directory to create your test browser
* @boxlang Is this a boxlang project? else it is a CFML project
*/
function run(
string directory = getCWD(),
boolean boxlang = isBoxLangProject( getCWD() )
boolean boxlang = isBoxLangProject( getCWD() )
){
// This will make each directory canonical and absolute
arguments.directory = resolvePath( arguments.directory & "/tests" );
Expand All @@ -30,7 +30,7 @@ component extends="testboxCLI.models.BaseCommand"{

// Copy template from testbox source
directoryCopy(
"#variables.settings.templatesPath#/#arguments.boxlang ? 'bx' : 'cfml'#/tests/",
"#variables.settings.templatesPath#/#arguments.boxlang ? "bx" : "cfml"#/tests/",
arguments.directory,
true
);
Expand Down
6 changes: 3 additions & 3 deletions commands/testbox/generate/module.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* testbox create module myModule tests/resources/modules
* {code}
*/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

/**
* @name The name of the module
Expand All @@ -21,7 +21,7 @@ component extends="testboxCLI.models.BaseCommand"{
function run(
required name,
string rootDirectory = getCWD(),
boolean boxlang = isBoxLangProject( getCWD() )
boolean boxlang = isBoxLangProject( getCWD() )
){
var moduleDirectory = resolvePath( arguments.rootDirectory ) & "/" & arguments.name;

Expand All @@ -31,7 +31,7 @@ component extends="testboxCLI.models.BaseCommand"{

// Copy template
directoryCopy(
"#variables.settings.templatesPath#/#arguments.boxlang ? 'bx' : 'cfml'#/module/",
"#variables.settings.templatesPath#/#arguments.boxlang ? "bx" : "cfml"#/module/",
moduleDirectory,
true
);
Expand Down
2 changes: 1 addition & 1 deletion commands/testbox/generate/visualizer.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* testbox create visualizer C:\myApp
* {code}
*/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

/**
* @directory The base directory to create your test visualizer
Expand Down
2 changes: 1 addition & 1 deletion commands/testbox/run.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* {code}
*
**/
component extends="testboxCLI.models.BaseCommand"{
component extends="testboxCLI.models.BaseCommand" {

// DI
property name="testingService" inject="TestingService@testbox-cli";
Expand Down
16 changes: 8 additions & 8 deletions models/BaseCommand.cfc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
component{
component {

// Global Injections
property name="settings" inject="box:modulesettings:testbox-cli";
property name="moduleConfig" inject="box:moduleConfig:testbox-cli";
property name="serverService" inject="serverService";
property name="settings" inject="box:modulesettings:testbox-cli";
property name="moduleConfig" inject="box:moduleConfig:testbox-cli";
property name="serverService" inject="serverService";
property name="packageService" inject="PackageService";

/**
Expand Down Expand Up @@ -124,22 +124,22 @@ component{
private function isBoxLangProject( required cwd ){
// Detect if it's a BoxLang server first.
var serverInfo = variables.serverService.resolveServerDetails( {} ).serverInfo;
if( serverInfo.cfengine.findNoCase( "boxlang" ) ){
if ( serverInfo.cfengine.findNoCase( "boxlang" ) ) {
return true;
}

// Detect if you have the BoxLang runner set.
var boxOptions = variables.packageService.readPackageDescriptor( arguments.cwd );
if(
if (
boxOptions.testbox.keyExists( "runner" )
&& isSimpleValue( boxOptions.testbox.runner )
&& boxOptions.testbox.runner == "boxlang"
){
) {
return true;
}

// Language mode
if( boxOptions.keyExists( "language" ) && boxOptions.language == "boxlang" ){
if ( boxOptions.keyExists( "language" ) && boxOptions.language == "boxlang" ) {
return true;
}

Expand Down

0 comments on commit d05e0de

Please sign in to comment.