<commit_before>"use strict";

var chai = require('chai');

var log = require('debug')('test:topic-stream');
var amqp = require('amqp');

var topicStream = require('../lib/topic-stream.js');

var expect = chai.expect;

describe('TopicStream', function () {

  function createQueue(connection, onData, cb) {
    connection.exchange('/test/events1234', {}, function (ex) {
      log('Exchange', ex.name, 'open');
      connection.queue('/queue/events1234', function (queue) {
        log('Queue', queue.name, 'open');
        queue.bind(ex, '#');
        // Receive messages
        queue.subscribe(onData);
        log('queue', 'cb');
        cb(queue)
      })
    })
  }

  it('should create a new topic stream', function (done) {

    var connection =<commit_msg>Ensure message routing is based on the binding.<commit_after>"use strict";

var chai = require('chai');

var log = require('debug')('test:topic-stream');
var amqp = require('amqp');

var topicStream = require('../lib/topic-stream.js');

var expect = chai.expect;

describe('TopicStream', function () {

  function createQueue(connection, onData, cb) {
    connection.exchange('/test/events1234', {}, function (ex) {
      log('Exchange', ex.name, 'open');
      connection.queue('/queue/sometest', function (queue) {
        log('Queue', queue.name, 'open');
        queue.bind(ex, '#');
        // Receive messages
        queue.subscribe(onData);
        log('queue', 'cb');
        cb(queue)
      })
    })
  }

  it('should create a new topic stream', function (done) {

    var connection =
{'fraction_non_alphanumeric': 0.1762820512820513, 'fraction_numerical': 0.007692307692307693, 'mean_word_length': 3.207547169811321, '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': '1317029', 'n_tokens_mistral': 488, 'n_tokens_neox': 466, 'n_words': 111}