<commit_before>'use strict';

module.exports = function (name) {
    var path = require('path'),
        testUtils = require('../../utils/test.js'),
        _ = require('underscore'),
        stylesheetGenerator = require('../../../lib/stylesheet/' + name + '.js');

    describe('Stylesheet/' + name, function () {
        var layout = {
                width: 150,
                height: 156,
                images: [
                    { path: '/bla/foo.png', x: 0, y: 0, width: 150, height: 12 },
                    { path: '/foo/bar.png', x: 0, y: 12, width: 150, height: 24 },
                    { path: '/images/test.png', x: 0, y: 36, width: 150, height: 12 }
                ]
            };

        it('should generate the correct ' + name + ' without any options', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/no-options.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, {}, done);
        });

        it('should generate the correct ' + name + ' with a prefix specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-prefix.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { prefix: 'sprite' }, done);
        });

        it('should generate the correct ' + name + ' with a spritePath specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-spritePath.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { spritePath: '/this/is/my/spritepath.png' }, done);
        });

        it('should generate the correct ' + name + ' with a custom nameMapping specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-nameMapping.' + name,
                nameMapping = function (imagePath) {
                    return path.basename(imagePath, path.extname(imagePath)).split("").reverse().join("");
                };
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { nameMapping: nameMapping }, done);
        });

        it('should generate the correct ' + name + ' with a pixelRatio specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-pixelRatio.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { pixelRatio: 2 }, done);<commit_msg>fix test prefix<commit_after>'use strict';

module.exports = function (name) {
    var path = require('path'),
        testUtils = require('../../utils/test.js'),
        _ = require('underscore'),
        stylesheetGenerator = require('../../../lib/stylesheet/' + name + '.js');

    describe('Stylesheet/' + name, function () {
        var layout = {
                width: 150,
                height: 156,
                images: [
                    { path: '/bla/foo.png', x: 0, y: 0, width: 150, height: 12 },
                    { path: '/foo/bar.png', x: 0, y: 12, width: 150, height: 24 },
                    { path: '/images/test.png', x: 0, y: 36, width: 150, height: 12 }
                ]
            };

        it('should generate the correct ' + name + ' without any options', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/no-options.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, {}, done);
        });

        it('should generate the correct ' + name + ' with a prefix specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-prefix.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { prefix: 'sprite-' }, done);
        });

        it('should generate the correct ' + name + ' with a spritePath specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-spritePath.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { spritePath: '/this/is/my/spritepath.png' }, done);
        });

        it('should generate the correct ' + name + ' with a custom nameMapping specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-nameMapping.' + name,
                nameMapping = function (imagePath) {
                    return path.basename(imagePath, path.extname(imagePath)).split("").reverse().join("");
                };
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { nameMapping: nameMapping }, done);
        });

        it('should generate the correct ' + name + ' with a pixelRatio specified', function (done) {
            var expectedStylesheetPath = 'test/fixtures/stylesheets/' + name + '/with-pixelRatio.' + name;
            testUtils.testStylesheetGeneration(stylesheetGenerator, layout, expectedStylesheetPath, { pixelRatio: 2 }, done);
{'fraction_non_alphanumeric': 0.13721768836591383, 'fraction_numerical': 0.011387360030366294, 'mean_word_length': 2.458005249343832, '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': '3100554', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1364, 'n_words': 349}