In the BDD style, I attempted to use the skip closures with the Given/When/Then structure. However, this did not work. Is this intentional? The documentation leads me to believe that these should have the same ability to “skip” like Describe does, but I see errors instead.
For instance, the example works flawlessly:
describe(title=“A railo suite”, body=function() {
it(“can be expected to run”, function() {
coldbox = 0;
coldbox++;expect( coldbox ).toBe( 1 );
});it(title=“can have more than one expectation and another skip closure”, body=function() {
coldbox = 0;
coldbox++;expect( coldbox ).toBe( 1 );
expect( coldbox ).toBeTrue();},skip=function(){
return false;
});},skip=function(){
return !structKeyExists( server, “railo” );
});
However, if I swap scernario for describe and story for it, like so:
function run( testResults, testBox ){
Scenario(title=“A railo suite”, body=function() {
Story(“can be expected to run”, function() {
coldbox = 0;
coldbox++;expect( coldbox ).toBe( 1 );
});Story(title=“can have more than one expectation and another skip closure”, body=function() {
coldbox = 0;
coldbox++;expect( coldbox ).toBe( 1 );
expect( coldbox ).toBeTrue();},skip=function(){
return false;
});},skip=function(){
return !structKeyExists( server, “railo” );
});
}
I get a failure:
Error Occurred While Processing Request
Error executing bundle - navpoint-tests.tests.specs.3000.HowToSkipTestsExample_Scenario message: The SCENARIO parameter to the Scenario function is required but was not passed in.
coldfusion.runtime.MissingArgumentException: The SCENARIO parameter to the Scenario function is required but was not passed in.
If I remove the title= I get the following error:
Error Occurred While Processing Request
Invalid CFML construct found on line 22 at column 36.
ColdFusion was looking at the following text:
=
What am I missing?