<commit_before>chai = require "chai"
sinon = require "sinon"
chai.use require "sinon-chai"

expect = chai.expect

describe "authority", ->
  beforeEach ->
    @robot =
      respond: sinon.spy()
      hear: sinon.spy()

    require("../src/authority")(@robot)

  it "registers a respond listener", ->
    expect(@robot.respond).to.have.been.calledWith(/hello/)

  it "registers a hear listener", ->
    expect(@robot.hear).to.have.been.calledWith(/orly/)<commit_msg>Fix tests<commit_after>chai = require "chai"
sinon = require "sinon"
chai.use require "sinon-chai"

expect = chai.expect

describe "authority", ->
  beforeEach ->
    @robot =
      respond: sinon.spy()
      hear: sinon.spy()
      listenerMiddleware: sinon.spy (context, next, done) =>
          # Do nothing

    require("../src/authority")(@robot)

  it "registers a respond listener", ->
    expect(@robot.respond).to.have.been.calledWith(/auth me/i)
    expect(@robot.respond).to.have.been.calledWith(/auth block (.+) (.+)/i)
    expect(@robot.respond).to.have.been.calledWith(/auth unblock (.+) (.+)/i)
    expect(@robot.respond).to.have.been.calledWith(/auth assign (.+) (.+)/i)
    expect(@robot.respond).to.have.been.calledWith(/auth unassign (.+) (.+)/i)
    expect(@robot.respond).to.have.been.calledWith(/auth default (.+)/i)

  it "registers a listener middleware", ->
    expect(@robot.listenerMiddleware).to.have.been.called
{'fraction_non_alphanumeric': 0.1813655761024182, 'fraction_numerical': 0.0, 'mean_word_length': 3.396875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '91302', 'n_tokens_mistral': 515, 'n_tokens_neox': 490, 'n_words': 87}