<commit_before>Helper = require('../node_modules/hubot-test-helper/src/index.coffee')

helper = new Helper('../scripts/dice.coffee')

expect = require('chai').expect

describe 'dice rolling', ->
  room = null

  beforeEach ->
    room = helper.createRoom()

  context 'user rolls 1d1', ->
    beforeEach ->
      room.user.say 'alice', '@hubot roll 1d1'
      room.user.say 'bob', '@hubot roll 1d0'
      room.user.say 'eric', '@hubot roll 1d-1'

    it 'should be invalid snarky message', ->
      expect(room.messages).to.eql [
        ['alice', '@hubot roll 1d1']
        ['hubot', '@alice You want to roll dice with less than two sides. Wow.']
        ['bob', '@hubot roll 1d0']
        ['hubot', '@bob You want to roll dice with less than two sides. Wow.']
        ['eric', '@hubot roll 1d-1']
        ['hubot', '@eric You want to roll dice with less than two sides. Wow.']
      ]<commit_msg>Fixed tests. They actually should pass now, I swear.<commit_after>Helper = require('../node_modules/hubot-test-helper/src/index.coffee')

helper = new Helper('../scripts/dice.coffee')

expect = require('chai').expect

describe 'when user rolls', ->
  room = null

  beforeEach ->
    room = helper.createRoom()

  context 'invalid dice', ->
    beforeEach ->
      room.user.say 'alice', '@hubot roll 1d1'
      room.user.say 'bob', '@hubot roll 1d0'
      room.user.say 'eric', '@hubot roll 1d-1'

    it 'should be snarky message', ->
      expect(room.messages).to.eql [
        ['alice', '@hubot roll 1d1']
        ['hubot', '@alice You want to roll dice with less than two sides. Wow.']
        ['bob', '@hubot roll 1d0']
        ['hubot', '@bob You want to roll dice with less than two sides. Wow.']
        ['eric', '@hubot roll 1d-1']
        # Nothing returns for last command.
      ]
{'fraction_non_alphanumeric': 0.15792410714285715, 'fraction_numerical': 0.014508928571428572, 'mean_word_length': 2.659183673469388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2604117', 'n_tokens_mistral': 620, 'n_tokens_neox': 582, 'n_words': 185}