/*
 { id: '1493203392599_46632f14-4e4c-4330-a949-0871d5838f43',
 message:
 { repo: 'happner/happn-protocol',
 event:
 { type: 'push',
 name: 'happn-protocol',
 owner: 'happner',
 branch: 'master' },
 config:
 { owner: 'happner',
 name: 'happn-protocol',
 node_js: [Object],
 job_type: 'happn-protocol',
 events: [Object] },
 job_type:
 { name: 'happn-protocol',
 path: '/Users/grant/Projects/Tenacious/NSoft/tracey/lib/job_types/happn-protocol/runner' },
 folder: '/Users/grant/Projects/Tenacious/NSoft/tracey/tracey_job_folder/happner/happn-protocol/1493203392599_46632f14-4e4c-4330-a949-0871d5838f43' } }
 */

var expect = require('expect.js');
var path = require('path');

var JobParser = require('../../../lib/parsers/job-parser');

describe('unit - happn-protocol job-runner', function () {

    this.timeout(30000);

    context('', function () {

        beforeEach('setup', function (done) {

            this.__parser = new JobParser();
            done();
        });

        afterEach('stop', function (done) {
            done();
        });

        context('job-parser', function () {

            it('successfully parses', function (done) {

                var mockJob = {
                    id: '1493203392599_46632f14-4e4c-4330-a949-0871d5838f43',
                    message: {
                        repo: 'happner/happn-protocol',
                        event: {
                            type: 'push',
                            name: 'happn-protocol',
                            owner: 'happner',
                            branch: 'master'
                        },
                        config: {
                            owner: 'happner',
                            name: 'happn-protocol',
                            node_js: {},
                            job_type: 'happn-protocol',
                            events: {}
                        },
                        job_type: {
                            name: 'happn-protocol',
                            path: '/Users/grant/Projects/Tenacious/NSoft/tracey/lib/job_types/happn-protocol/runner'
                        },
                        folder: '/Users/grant/Projects/Tenacious/NSoft/tracey/tracey_job_folder/happner/happn-protocol/1493203392599_46632f14-4e4c-4330-a949-0871d5838f43'
                    }
                };

                var result = this.__parser.parseJob(mockJob);

                expect(result.folder).to.be('/Users/grant/Projects/Tenacious/NSoft/tracey/tracey_job_folder/happner/happn-protocol/1493203392599_46632f14-4e4c-4330-a949-0871d5838f43')

                done();
            });

        });
    });
});

@@ -1,616 +1,4 @@
-/*%0A %7B id: '1493203392599_46632f14-4e4c-4330-a949-0871d5838f43',%0A message:%0A %7B repo: 'happner/happn-protocol',%0A event:%0A %7B type: 'push',%0A name: 'happn-protocol',%0A owner: 'happner',%0A branch: 'master' %7D,%0A config:%0A %7B owner: 'happner',%0A name: 'happn-protocol',%0A node_js: %5BObject%5D,%0A job_type: 'happn-protocol',%0A events: %5BObject%5D %7D,%0A job_type:%0A %7B name: 'happn-protocol',%0A path: '/Users/grant/Projects/Tenacious/NSoft/tracey/lib/job_types/happn-protocol/runner' %7D,%0A folder: '/Users/grant/Projects/Tenacious/NSoft/tracey/tracey_job_folder/happner/happn-protocol/1493203392599_46632f14-4e4c-4330-a949-0871d5838f43' %7D %7D%0A */%0A%0A
 var 
@@ -154,20 +154,20 @@
 col job-
-runn
+pars
 er', fun
@@ -1552,38 +1552,11 @@
 ers/
-grant/Projects/Tenacious/NSoft
+Bob
 /tra
@@ -1813,38 +1813,11 @@
 ers/
-grant/Projects/Tenacious/NSoft
+Bob
 /tra
@@ -1913,16 +1913,17 @@
 838f43')
+;
 %0A%0A      

Test cleanup