Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Last active May 2, 2016 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiejackson/ac96a01348db4026872ab50030bcce02 to your computer and use it in GitHub Desktop.
Save jamiejackson/ac96a01348db4026872ab50030bcce02 to your computer and use it in GitHub Desktop.
component
extends="testbox.system.BaseSpec"
{
/******************** "Global" setup/teardown *****************************/
/**
* @hint Executes before the *set* of all tests.
*/
function beforeAll(){
variables.thingsToTest = ["foo","bar","baz"];
}
/**
* @hint Executes after the *set* of all tests.
*/
function afterAll(){}
/*========================================================================*/
function run( testResults, testBox ){
/*
* @hint: Executes before each and every test.
*/
beforeEach(function( currentSpec ) {
// do something
});
/*
* @hint: Executes after each and every test.
*/
afterEach(function( currentSpec ) {
// do something
});
describe("Example suite", function(){
debug(variables);
for ( var thing in thingsToTest ) {
it( thing & "test" , function() {
expect(thing).toBe(thing);
});
}
});
}
}
variable [THINGSTOTEST] doesn't exist
Stacktrace The Error Occurred in
test.cfc: line 40
38: describe("Example suite", function(){
39: debug(structKeyList(variables));
40: for ( var thing in thingsToTest ) {
41: it( thing & "test" , function() {
42: expect(thing).toBe(thing);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment