var restify = require('../lib');
if (require.cache[__dirname + '/lib/helper.js']) {
    delete require.cache[__dirname + '/lib/helper.js'];
}
var helper = require('./lib/helper.js');


///--- Globals

var test = helper.test;

test('reviver', function (t) {
    var jsonBodyParser = restify.plugins.jsonBodyParser;

    var parser = jsonBodyParser({
        bodyReader: true,
        reviver: function (key, value) {
            if (key === '') {
                return (value);
            }
            return (value + value);
        }
    })[0];

    var req = {
        getContentType: function () {
            return ('application/json');
        },
        body: JSON.stringify({
            apple: 'red',
            orange: 'orange',
            banana: 'yellow'
        }),
        params: {}
    };

    parser(req, null, function () {
        t.equal(req.params.apple, 'redred');
        t.equal(req.params.orange, 'orangeorange');
        t.equal(req.params.banana, 'yellowyellow');
        t.end();
    });
});

test('no reviver', function (t) {
    var jsonBodyParser = restify.plugins.jsonBodyParser;

    var parser = jsonBodyParser({
        bodyReader: true
    })[0];

    var req = {
        getContentType: function () {
            return ('application/json');
        },
        body: JSON.stringify({
            apple: 'red',
            orange: 'orange',
            banana: 'yellow'
        }),
        params: {}
    };

    parser(req, null, function () {
        t.equal(req.params.apple, 'red');
        t.equal(req.params.orange, 'orange');
        t.equal(req.params.banana, 'yellow');
        t.end();
    });
});
@@ -1,12 +1,27 @@
+'use strict';%0A%0A
 var restify 
@@ -41,16 +41,17 @@
 /lib');%0A
+%0A
 if (requ
@@ -1637,28 +1637,30 @@
         t.end();%0A    %7D);%0A%7D);
+%0A%0A

fix style