<commit_before>/*
* Copyright (c) 2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

/*jslint node:true, nomen:true*/

"use strict";

var YUITest = require('yuitest'),
    A = YUITest.Assert,
    OA = YUITest.ObjectAssert,
    mockery = require('mockery'),
    pathToYUI = __dirname + '/../../node_modules/yui',
    pathToDefaultYUI = 'yui',
    mockYUI,
    mockDefaultYUI,
    suite,
    modown,
    configFn;

mockYUI = {
    path: function () {
        return "/foo/bar";
    },
    YUI: {
        version: '1.0'
    }
};
mockDefaultYUI = {
    path: function () {
        return "/default/foo/bar";
    },
    YUI: {
        version: '2.0'
    }
};
mockery.registerMock(pathToYUI, mockYUI);
mockery.registerMock(pathToDefaultYUI, mockDefaultYUI);
mockery.enable({
    warnOnReplace: false,
    warnOnUnregistered: false
});

suite = new YUITest.TestSuite("yui-test suite");

suite.add(new YUITest.TestCase({
    name: "yui-test",

    _should: {
        error: {
            "test config when yui() is not correctly initialized": true,
            "test constructor by calling it twice": true,
            "test constructor with specified YUI that does not exist": true
        },
        ignore: {
            "test debugMode": false
        }
    },

    setUp: function () {
        modown = require('../../lib/yui.js');
        if (modown.locals) {
            delete modown.locals;
        }
    },

    tearDown: function () {<commit_msg>Enable / disable mockery on test cycle<commit_after>/*
* Copyright (c) 2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

/*jslint node:true, nomen:true*/

"use strict";

var YUITest = require('yuitest'),
    A = YUITest.Assert,
    OA = YUITest.ObjectAssert,
    mockery = require('mockery'),
    pathToYUI = __dirname + '/../../node_modules/yui',
    pathToDefaultYUI = 'yui',
    mockYUI,
    mockDefaultYUI,
    suite,
    modown,
    configFn;

mockYUI = {
    path: function () {
        return "/foo/bar";
    },
    YUI: {
        version: '1.0'
    }
};
mockDefaultYUI = {
    path: function () {
        return "/default/foo/bar";
    },
    YUI: {
        version: '2.0'
    }
};

suite = new YUITest.TestSuite("yui-test suite");

suite.add(new YUITest.TestCase({
    name: "yui-test",

    _should: {
        error: {
            "test config when yui() is not correctly initialized": true,
            "test constructor by calling it twice": true,
            "test constructor with specified YUI that does not exist": true
        },
        ignore: {
            "test debugMode": false
        }
    },

    setUp: function () {

        mockery.registerMock(pathToYUI, mockYUI);
        mockery.registerMock(pathToDefaultYUI, mockDefaultYUI);
        mockery.enable({
            warnOnReplace: false,
            warnOnUnregistered: false
        });

        modown = require('../../lib/yui.js');
        if (modown.locals) {
            delete modown.locals;
        }
    },

    tearDown: function () {
        mockery.deregisterMock(pathToYUI);
        mockery.deregisterMock(pathToDefaultYUI);
        mockery.disable();

{'fraction_non_alphanumeric': 0.13119266055045872, 'fraction_numerical': 0.004892966360856269, 'mean_word_length': 2.191219512195122, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3272753', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1040, 'n_words': 252}