[TestBox book] syntax error

Hi,

Was just browsing through the TestBox book (which looks really good by the way!) and spotted an mistake:

http://testbox.ortusbooks.com/content/primers/bdd/expectations.html

it("The 'toHaveDeepKey' checks for existence of keys anywhere in structs", function() {
  expect( { name="luis", { age=35, awesome=true } } ).toHaveKey( 'age' );
});

The example should be:

it("The 'toHaveDeepKey' checks for existence of keys anywhere in structs", function() {
  expect( { name="luis", bio={ age=35, awesome=true } } ).toHaveDeepKey( 'age' );
});

The current version will throw a syntax error as the struct key name is missing. After that it’ll fail as it’s not doing the deep check.

Hope that’s useful. I did try and see if I could submit the update as Pull Request but couldn’t find the repo.

Cheers,

John

Just been looking at the “Nesting describe Blocks” in the TestBox book (http://testbox.ortusbooks.com/content/primers/bdd/suite_groups.html). The last test (highlighted) caught my eye as I didn’t think you could do that. So I’ve simplified it a little bit, so I could try it out, but it gives me an error:

can be declared after nested suites and have access to nested variables (1 ms) - Variable AWESOME is undefined.

component extends=“testbox.system.BaseSpec” {

function run(testResults, testBox){
describe(“A spec”, function() {

beforeEach(function( currentSpec ) {
coldbox = 22;
});

afterEach(function( currentSpec ) {
coldbox = 0;
});

it(“is just a function, so it can contain any code”, function() {
expect( coldbox ).toBe( 22 );
expect( testbox.getVersion() ).toBe( “2.1.0+00008” );
});

describe(“nested inside a second describe”, function() {

beforeEach(function( currentSpec ) {
awesome = 22;
});

afterEach(function( currentSpec ) {
awesome = 22 + 8;
});

it("can reference both scopes as needed ", function() {
expect( coldbox ).toBe( awesome );
});
});

it(“can be declared after nested suites and have access to nested variables”, function() {
expect( awesome ).toBe( 30 );
});

});
};
}

Tested on CF10 in case that makes a difference.

Cheers,

John