Example #1
0
        "Valid json from file": function() {
            var conf = {},
                args = {};

            var dp = new dataProv(conf, args,__dirname + "/testDescriptor.json"),
                validJson = dp.readAndValidateJSON(__dirname + '/replaceParams/replaceParam.json');

            Y.Assert.areEqual(JSON.stringify(validJson), '{"site":"yahoo","property":"news"}');
        }
Example #2
0
        "Empty json string": function() {
            var conf = {},
                args = {};

            var dp = new dataProv(conf, args, __dirname + "/testDescriptor.json"),
                emptyJson = dp.readAndValidateJSON('{}');

            Y.Assert.areEqual(JSON.stringify(emptyJson), '{}');
        }
Example #3
0
        "Valid json string": function() {
            var conf = {},
                args = {};

            var dp = new dataProv(conf, args,__dirname + "/testDescriptor.json"),
                validJson = dp.readAndValidateJSON('{"key1":"value1","key2":"value2"}');

            Y.Assert.areEqual(JSON.stringify(validJson), '{"key1":"value1","key2":"value2"}');
        }
Example #4
0
        "blank json string": function() {
            var conf = {},
                args = {};

            var dp = new dataProv(conf, args,__dirname + "/testDescriptor.json"),
                blankJson = dp.readAndValidateJSON('');

            Y.Assert.areEqual(blankJson, undefined);
        }