<commit_before>/*
 * Copyright (c) 2011-2012, Yahoo! Inc.  All rights reserved.
 * Copyrights licensed under the New BSD License.
 * See the accompanying LICENSE file for terms.
 */
YUI.add('mojito-resource-store-adapter-tests', function(Y, NAME) {

    var suite = new YUITest.TestSuite(NAME),
        path = require('path'),
        fixtures = path.join(__dirname, '../../../fixtures/store'),
        dummyLog = {log: function() {}},
        A = YUITest.Assert;

    suite.add(new YUITest.TestCase({

        name: 'Resource Store Adapter Tests',

        'pre load': function() {
            var resourceStore,
                store;

            resourceStore = new Y.mojito.ResourceStore({ root: fixtures });
            resourceStore.preload();

            store = Y.mojito.ResourceStoreAdapter.init('server', resourceStore, dummyLog);
            A.isTrue(store.getAppPath() === fixtures);
        },

        'server app config value': function() {
            var resourceStore,
                store;

            resourceStore = new Y.mojito.ResourceStore({ root: fixtures });
            resourceStore.preload();

            store = Y.mojito.ResourceStoreAdapter.init('server', resourceStore, dummyLog);
            var config = store.getAppConfig(null, 'application');
            A.isTrue(config.testKey1 === 'testVal1');
        },

        'server mojit config value': function() {
            var resourceStore,
                store;

            resourceStore = new Y.mojito.ResourceStore({ root: fixtures });
            resourceStore.preload();

            store = Y.mojito.ResourceStoreAdapter.init('server', resourceStore, dummyLog);
            var instance = {base:'test1'};
            store.expandInstance(instance, {}, function(err, instance){
                A.isTrue(instance.id === 'test1');
                A.isTrue(instance.type === 'test_mojit_1');
                A.isTrue(instance.config.testKey4 === 'testVal4');<commit_msg>fixed up call to store.getAppConfig()<commit_after>/*
 * Copyright (c) 2011-2012, Yahoo! Inc.  All rights reserved.
 * Copyrights licensed under the New BSD License.
 * See the accompanying LICENSE file for terms.
 */
YUI.add('mojito-resource-store-adapter-tests', function(Y, NAME) {

    var suite = new YUITest.TestSuite(NAME),
        path = require('path'),
        fixtures = path.join(__dirname, '../../../fixtures/store'),
        dummyLog = {log: function() {}},
        A = YUITest.Assert;

    suite.add(new YUITest.TestCase({

        name: 'Resource Store Adapter Tests',

        'pre load': function() {
            var resourceStore,
                store;

            resourceStore = new Y.mojito.ResourceStore({ root: fixtures });
            resourceStore.preload();

            store = Y.mojito.ResourceStoreAdapter.init('server', resourceStore, dummyLog);
            A.isTrue(store.getAppPath() === fixtures);
        },

        'server app config value': function() {
            var resourceStore,
                store;

            resourceStore = new Y.mojito.ResourceStore({ root: fixtures });
            resourceStore.preload();

            store = Y.mojito.ResourceStoreAdapter.init('server', resourceStore, dummyLog);
            var config = store.getAppConfig(null);
            A.isTrue(config.testKey1 === 'testVal1');
        },

        'server mojit config value': function() {
            var resourceStore,
                store;

            resourceStore = new Y.mojito.ResourceStore({ root: fixtures });
            resourceStore.preload();

            store = Y.mojito.ResourceStoreAdapter.init('server', resourceStore, dummyLog);
            var instance = {base:'test1'};
            store.expandInstance(instance, {}, function(err, instance){
                A.isTrue(instance.id === 'test1');
                A.isTrue(instance.type === 'test_mojit_1');
                A.isTrue(instance.config.testKey4 === 'testVal4');
{'fraction_non_alphanumeric': 0.13106426212852426, 'fraction_numerical': 0.00762001524003048, 'mean_word_length': 2.193836171938362, 'pattern_counts': {'":': 0, '<': 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': '6275061', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1044, 'n_words': 240}