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

expect = chai.expect

describe 'ingress: cycle times', ->
  robot =
    respond: sinon.spy()
    hear: sinon.spy()

  beforeEach ->
    @robot = robot
    @msg =
      send: sinon.spy()
      reply: sinon.spy()
      envelope:
        user:
          @user
      message:
        user:
          @user

  require("../src/cycle-times")(robot)

  it 'registers "cycle" listener', ->
    expect(@robot.respond).to.have.been.calledWith /(septi)?cycle\s*([0-9])?/i

  it 'registers "checkpoint" listener', ->
    expect(@robot.respond).to.have.been.calledWith /c(heck)?p(oint)?\s*([0-9])?/i

  it 'registers "cycle offset" listener', ->
    expect(@robot.respond).to.have.been.calledWith /cycle offset/i

  it 'registers "cycle set offset" listener', ->
    expect(@robot.respond).to.have.been.calledWith /cycle set offset (.*)/i

  it 'registers "cycle set offsetname" listener', ->
    expect(@robot.respond).to.have.been.calledWith /cycle set offsetname (.*)/i<commit_msg>Update test<commit_after>chai = require 'chai'
sinon = require 'sinon'
chai.use require 'sinon-chai'

expect = chai.expect

describe 'ingress: cycle times', ->
  robot =
    respond: sinon.spy()
    hear: sinon.spy()

  beforeEach ->
    @robot = robot
    @msg =
      send: sinon.spy()
      reply: sinon.spy()
      envelope:
        user:
          @user
      message:
        user:
          @user

  require("../src/cycle-times")(robot)

  it 'registers "cycle" listener', ->
    expect(@robot.respond).to.have.been.calledWith /(septi)?cycle\s*([0-9])?$/i

  it 'registers "checkpoint" listener', ->
    expect(@robot.respond).to.have.been.calledWith /c(heck)?p(oint)?\s*([0-9])?/i

  it 'registers "cycle offset" listener', ->
    expect(@robot.respond).to.have.been.calledWith /cycle offset/i

  it 'registers "cycle set offset" listener', ->
    expect(@robot.respond).to.have.been.calledWith /cycle set offset (.*)/i

  it 'registers "cycle set offsetname" listener', ->
    expect(@robot.respond).to.have.been.calledWith /cycle set offsetname (.*)/i
{'fraction_non_alphanumeric': 0.16910032972209138, 'fraction_numerical': 0.0037682524729156855, 'mean_word_length': 2.918819188191882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '1531506', 'n_tokens_mistral': 771, 'n_tokens_neox': 747, 'n_words': 154}