<commit_before>describe('busterbunny.js - raiseEvents invocation of the afterRaised callback', function() {
    var assert = require('assert');
    var expect = require('chai').expect;
    var mockery = require('mockery');

    before(function() {
        mockery.enable({
            useCleanCache: true,
            warnOnUnregistered: false
        });
    });

    afterEach(function() {
        mockery.deregisterAll();
    });

    var fakeConfig = {
        cluster: {
            host: 'host.host.it',
            port: 5672,
            vhost: '/',
            login: 'someguy',
            password: '<PASSWORD>',
            heartbeat: 10
        },
        queues: [
            {
                name: 'i.read.from.this1'
            },
            {
                name: 'i.read.from.this2'
            }
        ],
        exchange: 'i.write.2.this1'
    };

    it('should invoke afterRaised without parameters when options are specified publish is successful', function(done) {
        var eventId = 'someValidString';
        var event = {};
        var options = {};
        var afterRaised = function(err) {
            expect(err).to.be.undefined;
            done();
        };

        var AmqpMock = require('./mock-amqp.js');
        var amqpMock = new AmqpMock();

        amqpMock.connect = function(someUrl, onConnected) {
            onConnected(null, {
                createChannel: function(onChannelCreated) {
                    onChannelCreated(null, {
                        publish: function(exchange, routingKey, content, options) {
                        }
                    });
                },
                on: function() {
                }
            });
        };

        mockery.registerMock('amqplib/callback_api', amqpMock);

        var BusterBunny = require('../../src/busterbunny.js');
        var busterBunny = new BusterBunny(fakeConfig);

        busterBunny.raiseEvents(eventId, event, options, afterRaised);
    });

    it('should invoke afterRaised without parameters when options are not specified publish is successful', function(done) {
        var eventId = 'someValidString';
        var event = {};
        var options = undefined;
        var afterRaised = function(err) {
            expect(err).to.be.undefined;
            done();
        };

        var AmqpMock = require('./mock-amqp.js');
        var amqpMock = new AmqpMock();

        amqpMock.connect = function(someUrl, onConnected) {
            onConnected(null, {
                createChannel: function(onChannelCreated) {
                    onChannelCreated(null, {
                        publish: function(exchange, routingKey, content, options) {
                        }<commit_msg>ISSUE-6 - fixed it texts to be consistent.<commit_after>describe('busterbunny.js - raiseEvents invocation of the afterRaised callback', function() {
    var assert = require('assert');
    var expect = require('chai').expect;
    var mockery = require('mockery');

    before(function() {
        mockery.enable({
            useCleanCache: true,
            warnOnUnregistered: false
        });
    });

    afterEach(function() {
        mockery.deregisterAll();
    });

    var fakeConfig = {
        cluster: {
            host: 'host.host.it',
            port: 5672,
            vhost: '/',
            login: 'someguy',
            password: '<PASSWORD>',
            heartbeat: 10
        },
        queues: [
            {
                name: 'i.read.from.this1'
            },
            {
                name: 'i.read.from.this2'
            }
        ],
        exchange: 'i.write.2.this1'
    };

    it('should invoke afterRaised without parameters when options are specified and channel publish is successful', function(done) {
        var eventId = 'someValidString';
        var event = {};
        var options = {};
        var afterRaised = function(err) {
            expect(err).to.be.undefined;
            done();
        };

        var AmqpMock = require('./mock-amqp.js');
        var amqpMock = new AmqpMock();

        amqpMock.connect = function(someUrl, onConnected) {
            onConnected(null, {
                createChannel: function(onChannelCreated) {
                    onChannelCreated(null, {
                        publish: function(exchange, routingKey, content, options) {
                        }
                    });
                },
                on: function() {
                }
            });
        };

        mockery.registerMock('amqplib/callback_api', amqpMock);

        var BusterBunny = require('../../src/busterbunny.js');
        var busterBunny = new BusterBunny(fakeConfig);

        busterBunny.raiseEvents(eventId, event, options, afterRaised);
    });

    it('should invoke afterRaised without parameters when options are not specified and channel publish is successful', function(done) {
        var eventId = 'someValidString';
        var event = {};
        var options = undefined;
        var afterRaised = function(err) {
            expect(err).to.be.undefined;
            done();
        };

        var AmqpMock = require('./mock-amqp.js');
        var amqpMock = new AmqpMock();

        amqpMock.connect = function(someUrl, onConnected) {
            onConnected(null, {
                createChannel: function(onChannelCreated) {
                    onChannelCreated(null, {
                        publish: function(exchange, routingKey, content, options) {
                        }
{'fraction_non_alphanumeric': 0.11296464188576609, 'fraction_numerical': 0.0038077969174977336, 'mean_word_length': 1.6129796305068689, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5528221', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1411, 'n_words': 312}