<commit_before>source = '../scripts/lgtm'
expect = require('chai').expect

Robot       = require('hubot/src/robot')  
TextMessage = require('hubot/src/message').TextMessage

describe 'lgtm', ->  
  robot = null
  user = null
  adapter = null

  beforeEach (done) ->
    robot = new Robot(null, 'mock-adapter', false, 'hubot')

    robot.adapter.on 'connected', ->
      require(source)(robot)
      user = robot.brain.userForId '1',
        name: 'mocha'
        room: '#mocha'
      adapter = robot.adapter
      done()
    robot.run()

  afterEach -> robot.shutdown()

  it 'should respond to a LGTM image', (done) ->
    adapter.on 'send', (envelope, strings) ->
      try
        expect(strings[0]).to.match(/^https?:\/\//)
        done()
      catch e
        done e

    adapter.receive(new TextMessage(user, 'lgtm'))
<commit_msg>test a tiqav image<commit_after>source = '../scripts/lgtm'
expect = require('chai').expect

Robot       = require('hubot/src/robot')  
TextMessage = require('hubot/src/message').TextMessage

describe 'lgtm', ->  
  robot = null
  user = null
  adapter = null

  beforeEach (done) ->
    robot = new Robot(null, 'mock-adapter', false, 'hubot')

    robot.adapter.on 'connected', ->
      require(source)(robot)
      user = robot.brain.userForId '1',
        name: 'mocha'
        room: '#mocha'
      adapter = robot.adapter
      done()
    robot.run()

  afterEach -> robot.shutdown()

  it 'should respond to a LGTM image', (done) ->
    adapter.on 'send', (envelope, strings) ->
      try
        expect(strings[0]).to.match(/^https?:\/\//)
        done()
      catch e
        done e

    adapter.receive(new TextMessage(user, 'lgtm'))

  it 'should respond to a tiqav image', (done) ->
    adapter.on 'send', (envelope, strings) ->
      try
        expect(strings[0]).to.match(/^https?:\/\/tiqav\.com\//)
        done()
      catch e
        done e

    adapter.receive(new TextMessage(user, 'hubot reply thanks'))

{'fraction_non_alphanumeric': 0.15985699693564862, 'fraction_numerical': 0.002553626149131767, 'mean_word_length': 2.448943661971831, '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': '6399456', 'n_tokens_mistral': 667, 'n_tokens_neox': 650, 'n_words': 151}