The Ortus BlogBox

"Ortus: A rise, beginning, coming into being, born, the origin!"



Category Filtering: 'testbox'


CFObjective 2017 - 3 WAYS TO TEST YOUR COLDFUSION API - Gavin Pickin

Gavin Pickin
Jul 24, 2017


Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.

We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.

Conferences, Presentations, REST, TestBox 2

CFObjective 2017 - Automate Thyself - Luis Majano

Luis Majano
Jul 24, 2017


At this year's CF.Objective I had the privilege to present on testing and automation. Here are the slides for the presentation and you can find the test source code in github:

Automate Thyself Synopsis

In this advanced session, we will investigate all the ways that you can automate your testing processes with TestBox and many CI and automation tools. From Jenkins integration, Travis CI, Node runners, Grunt watchers and much more. This session will show you the value of continuous integration and how to apply it with modern tools and technologies.

Conferences, Presentations, TestBox 0

Using "testbox watch" to Automate Your Testing Suite

Brad Wood
May 19, 2017


Using "testbox watch" to Automate Your Testing Suite

There is a new command in town in the CommandBox 3.7 snapshot build.  If you want to get the current snapshot build of CommandBox 3.7 to try this out, and play with it, simply run the following command and it will direct you to the latest bleeding edge download page:

CommandBox> upgrade --latest
CommandBox, TestBox, Tutorials 0

TestBox v2.5.0 Released!

Luis Majano
May 18, 2017


We are excited to announce the release of TestBox version 2.5.0. To install just do:

box install testbox --savedev

To upgrade your current testbox installation just run the following:

box uninstall testbox && install testbox --savedev

TestBox 2.5.0 is a minor release with some great new functionality and tons of fixes. You can find the release notes here and the major updates for this release. One of the biggest features for TestBox that was not part of TestBox, was the addition of TestBox Watchers to CommandBox.

ColdBox MVC, ColdFusion, Community, News, Releases, TestBox 0

Content Box Theme Development: Creating a CI Pipeline

Jon Clausen
Aug 05, 2016


An incredibly powerful feature of ContentBox 3 is the increasing availability of open source themes to jump start your custom development.   For those wishing to contribute back to the community, creating your own theme is as simple as cloning one of our boilerplate themes, creating a new GitHub repo for your customizations, and publishing your theme on Forgebox.  

ContentBox CMS, TestBox, Tutorials 0

Spec Data Binding in TestBox

Luis Majano
May 06, 2016


This issue has comed up several times in our mailing lists, so why not expand a little with a blog post.

The Problem

Many developers working with TestBox love the BDD approach to spec design. Once they get familiar with the syntax they start getting funky! It is just natural! Since they are coding within a CFC they decide to create dynamic it() or specs by iterating over some type of data collection (queries,arrays,structs). The first iteration of the code might look like this:

// Complex Example
for( var filePath in files ){

    it("#getFileFromPath(filePath)# should be valid JSON", function() {
        var json = fileRead(filePath);
        var isItJson = isJSON(json);
        if (isItJson) {
            var data = deserializeJSON(json);
            if (getFileFromPath(filePath) != "index.json") {


The Expectation

Now, you would really expect this to work, and it partially does. What you will see is that only the last binding of the iteration works. This is due to the fact that you are iterating and creating closures at runtime. The problem is that closures rely on its environment when executed, not when defined. So in reality, once TestBox executes these closures for evaluation purposes, the last filePath is the one used, since that is the contents of the variable at the time of the execution of the closure, NOT the definition of the closure.

I know, I know, this is really hurting your brain. That's ok. You are getting funky, doesn't mean it is always easy. Anyways, thankfully, TestBox provides a workaround so you can actually bind the spec with runtime definitions so your closures can actually take the right data.

The Solution

The solutions is to use spec data binding in TestBox. Each closure that defines the it() spec, accepts a data argument which is a structure.

it( title="", data={}, body=function( data ){} );

This is passed by TestBox automatically for you. All you have to do is bind it. You do this by passing another argument to the it() spec called data. This now allows you to update your code to the following:

// Complex Example. Let's iterate over a bunch of files and create dynamic specs
for( var filePath in files ){

    title="#getFileFromPath( filePath )# should be valid JSON", 
    // pass in a struct of data to the spec for later evaluation
    data = { filePath = filePath },
    // the spec closure accepts the data for later evaluation
    function( data ) {
      var json = fileRead( data.filePath );
      var isItJson = isJSON( json );

      expect( json ).notToBeEmpty();
      expect( isItJson ).toBeTrue();

      if( isItJson ){
          var jsonData = deserializeJSON(json);
          if( getFileFromPath( filePath ) != "index.json"){
              expect( jsonData ).toHaveKey( "name" );
              expect( jsonData ).toHaveKey( "type" );


Now you can generate dynamic specs and bind them accordingly at runtime! Enjoy!

TestBox, Tutorials 0

REST2016 - Testing your API with TestBox

Gavin Pickin
Mar 18, 2016


Are you writing APIs? Going to start writing APIs? Now is the time to start testing. Do it early, and often, and reap the benefits as the project grows. TestBox, the defacto CFML test suite, can help your test your API, whether it’s CFML or not.

I will assume you have the basic TextBox installation setup.

ColdBox MVC, REST, RoadShow, TestBox 1

TestBox v2.3.0 Released!

Luis Majano
Mar 11, 2016


Team TestBox is proud to bring our latest release to the masses, v2.3.0.  This release includes a collection of fixes but also several new cool features thanks to Mr Eric Peterson and our Slack community. It has been incredible to get so much community support in this project and so many pull requests and even to our documentation. So thank you so much for supporting and believing in us. This release is for you!

All the docs have been updated in our documentation book and check out the what's new page for an in-depth overview of this release.

You can also very easily get started or update your project with TestBox via CommandBox CLI for ColdFusion (CFML):

ColdBox MVC, ColdFusion, Community, News, Releases, TestBox 0

Build, Test, and Deploy Your Module with Travis CI

Jon Clausen
Feb 15, 2016


In its early stages, shipping your new module isn't such a big deal.  The .zip link provided by GitHub works fine for the Forgebox link, and it's not a big deal to update the entry whenever you release a new version.  Once you release it and other developers actually start using and depending on your software, however, the need to automate aspects of the build and deployment process become apparent.  
ColdBox MVC, CommandBox, ForgeBox, TestBox 3

TestBox v2.2.0 Released!

Luis Majano
Oct 21, 2015


Team TestBox is proud to bring our latest release to fruition, v2.2.0.  This release includes a collection of fixes but also several new cool features like gherkins-like syntax support, spec data binding, test listeners and much more.  We invite you to read our updated documentation book and the what's new page for an in-depth overview of the release.

You can also very easily get started or update your project with TestBox via CommandBox CLI for ColdFusion (CFML):

# install testbox
box install testbox

# update testbox
box update testbox

#what you thought there was more?

Major Features

Below you can find quick updates on our major features for this release.

ColdBox MVC, ColdFusion, Community, News, Releases, TestBox 0
1 2 3 4 5 6 >>