lib/inspector.js
function compare(specValue, comparisonValue, currentDescription) {

    var lengthIndex = currentDescription.length - 1,
        suite = currentDescription.slice(0, (lengthIndex)).join(" "),
        spec = currentDescription[lengthIndex],
        object = {};

    if (suite === "") {
        object[spec] = specValue;
    } else {
        object[suite] = {};
        object[suite][spec] = specValue;
    }

    if (typeof(specValue) !== 'undefined' && typeof(comparisonValue) !== 'undefined') {
        if (comparisonValue === "PASSED") {
            response.passed.push(object);
        } else {
            response.failed.push(object);
        }
    } else {
        if (config.hint) {
            console.log(("ShouldIt? is running in " + config.hint + " hint mode.\n").green);
            console.log("One of your features has not been implelented.");
            console.log((object[suite][spec] + '\n').grey);
            console.log("The recommended test for you to implement is below:\n");
            console.log(templates(config.hint, suite, spec).yellow);
            console.log("\n");
            throw "end";
        }
        response.pending.push(object);
    }

}
function compare(specValue, comparisonValue, currentDescription) {

    var lengthIndex = currentDescription.length - 1,
        suite = currentDescription.slice(0, (lengthIndex)).join(" "),
        spec = currentDescription[lengthIndex],
        object = {};

    if (suite === "") {
        object[spec] = specValue;
    } else {
        object[suite] = {};
        object[suite][spec] = specValue;
    }

    if (typeof(specValue) !== 'undefined' && typeof(comparisonValue) !== 'undefined') {
        if (comparisonValue === "PASSED") {
            response.passed.push(object);
        } else {
            response.failed.push(object);
        }
    } else {
        if (config.hint) {
            console.log(("ShouldIt? is running in " + config.hint + " hint mode.\n").green);
            console.log("One of your features has not been implelented.");
            console.log((object[suite][spec] + '\n').grey);
            console.log("The recommended test for you to implement is below:\n");
            console.log(templates(config.hint, suite, spec).yellow);
            console.log("\n");
            throw "end";
        }
        response.pending.push(object);
    }

}
function compare ( specValue , comparisonValue , currentDescription ) { var lengthIndex = currentDescription . length - 1 , suite = currentDescription . slice ( 0 , ( lengthIndex ) ) . join ( " " ) , spec = currentDescription [ lengthIndex ] , object = { } ; if ( suite === "" ) { object [ spec ] = specValue ; } else { object [ suite ] = { } ; object [ suite ] [ spec ] = specValue ; } if ( typeof ( specValue ) !== 'undefined' && typeof ( comparisonValue ) !== 'undefined' ) { if ( comparisonValue === "PASSED" ) { response . passed . push ( object ) ; } else { response . failed . push ( object ) ; } } else { if ( config . hint ) { console . log ( ( "ShouldIt? is running in " + config . hint + " hint mode.\n" ) . green ) ; console . log ( "One of your features has not been implelented." ) ; console . log ( ( object [ suite ] [ spec ] + '\n' ) . grey ) ; console . log ( "The recommended test for you to implement is below:\n" ) ; console . log ( templates ( config . hint , suite , spec ) . yellow ) ; console . log ( "\n" ) ; throw "end" ; } response . pending . push ( object ) ; } }
Compare results and build the response
Compare results and build the response