spec/lib/jobs/poweron-node-spec.js
function() {
        //var logger = Logger.initialize(mockChildProcessFactory);
        function MockChildProcess() {}
        MockChildProcess.prototype.run = function run (command, args) {
            // logger.debug("CHILD PROCESS MOCK!");
            // logger.debug("command: "+command);
            // logger.debug("args: "+args);
            // logger.debug("env: "+env);
            // logger.debug("code: "+code);
            if ((command === 'ipmitool') && _.contains(args, 'status')) {
                // power status call, return a "success"
                return Promise.resolve({
                    stdout: 'Chassis Power is on'
                });
            }
        };
        return MockChildProcess;
    }
function() {
        //var logger = Logger.initialize(mockChildProcessFactory);
        function MockChildProcess() {}
        MockChildProcess.prototype.run = function run (command, args) {
            // logger.debug("CHILD PROCESS MOCK!");
            // logger.debug("command: "+command);
            // logger.debug("args: "+args);
            // logger.debug("env: "+env);
            // logger.debug("code: "+code);
            if ((command === 'ipmitool') && _.contains(args, 'status')) {
                // power status call, return a "success"
                return Promise.resolve({
                    stdout: 'Chassis Power is on'
                });
            }
        };
        return MockChildProcess;
    }
function ( ) { //var logger = Logger.initialize(mockChildProcessFactory); function MockChildProcess ( ) { } MockChildProcess . prototype . run = function run ( command , args ) { // logger.debug("CHILD PROCESS MOCK!"); // logger.debug("command: "+command); // logger.debug("args: "+args); // logger.debug("env: "+env); // logger.debug("code: "+code); if ( ( command === 'ipmitool' ) && _ . contains ( args , 'status' ) ) { // power status call, return a "success" return Promise . resolve ( { stdout : 'Chassis Power is on' } ) ; } } ; return MockChildProcess ; }
mock up the ChildProcess injectable to capture calls before they go to a local shell
mock up the ChildProcess injectable to capture calls before they go to a local shell