1 | chai = require 'chai'
|
2 | sinon = require 'sinon'
|
3 | chai.use require 'sinon-chai'
|
4 |
|
5 | expect = chai.expect
|
6 |
|
7 | describe 'hubot-frinkiac', ->
|
8 | beforeEach ->
|
9 | @robot =
|
10 | respond: sinon.spy()
|
11 | hear: sinon.spy()
|
12 |
|
13 | require('../src/frinkiac')(@robot)
|
14 |
|
15 | it 'registers a respond listener for "simpsons search <query>"', ->
|
16 | expect(@robot.respond).to.have.been.calledWithMatch sinon.match((val) ->
|
17 | val.test "simpsons search d'oh!"
|
18 | )
|
19 |
|
20 | it 'registers a respond listener for "frinkiac <query>"', ->
|
21 | expect(@robot.respond).to.have.been.calledWithMatch sinon.match((val) ->
|
22 | val.test "frinkiac i'd be stupid not to do this"
|
23 | )
|
24 |
|
25 | it 'does NOT register a hear listener', ->
|
26 | expect(@robot.hear).to.not.have.been.calledWith sinon.match((val) ->
|
27 | val.test "simpsons search"
|
28 | )
|