<commit_before>var assert = require('assert');
var GitterBot = require('../lib/GitterBot');
var API_KEY = 'API_KEY';

describe('GitterBot', function () {
  it('Should properly exports', function () {
    assert.equal(typeof GitterBot, 'function');
  });

  it('Should properly create instance of GitterBot', function () {
    assert(new GitterBot() instanceof GitterBot);
  });

  it('Should properly create GitterBot with API Key', function () {
    var bot = new GitterBot(API_KEY);

    assert.equal(bot.getApiKey(), API_KEY);
  });

  it('Should properly start gitter bot for listening', function () {
    var bot = new GitterBot(API_KEY);

    assert(!bot._isStarted);
    assert(bot.start() instanceof GitterBot);
    assert(bot._isStarted);
  });

  it('Should properly stop gitter bot for listening', function () {
    var bot = new GitterBot(API_KEY);

    assert(bot._isStarted);
    assert(bot.stop() instanceof GitterBot);
    assert(!bot._isStarted);
  });

  it('Should properly reconnect', function () {
    var bot = new GitterBot(API_KEY);
    assert(bot.reconnect() instanceof GitterBot);
  });
});
<commit_msg>Write tests<commit_after>var assert = require('assert');
var GitterBot = require('../lib/GitterBot');
var API_KEY = 'API_KEY';
var ROOM_NAME = 'ghaiklor/uwcua-vii';
var EXEC_PATTERN = /^calc\s*/;

describe('GitterBot', function () {
  it('Should properly exports', function () {
    assert.equal(typeof GitterBot, 'function');
  });

  it('Should properly create instance of GitterBot', function () {
    assert(new GitterBot() instanceof GitterBot);
  });

  it('Should properly get/set API key', function () {
    var bot = new GitterBot({apiKey: API_KEY});
    assert.equal(bot.getApiKey(), API_KEY);

    bot.setApiKey('new-api-key');
    assert.equal(bot.getApiKey(), 'new-api-key');
  });

  it('Should properly get/set room name', function () {
    var bot = new GitterBot({roomName: ROOM_NAME});
    assert.equal(bot.getRoomName(), ROOM_NAME);

    bot.setRoomName('new-room');
    assert.equal(bot.getRoomName(), 'new-room');
  });

  it('Should properly get/set exec pattern', function () {
    var bot = new GitterBot({execPattern: EXEC_PATTERN});
    assert.equal(bot.getExecPattern(), EXEC_PATTERN);

    bot.setExecPattern('^my pattern');
    assert.equal(bot.getExecPattern(), '^my pattern');
  });
});

{'fraction_non_alphanumeric': 0.16063059224541967, 'fraction_numerical': 0.0, 'mean_word_length': 4.217777777777778, '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': '7213808', 'n_tokens_mistral': 764, 'n_tokens_neox': 742, 'n_words': 174}