-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some coveralls tests and ignores
- Loading branch information
John Agan
committed
Jun 17, 2016
1 parent
c244c3d
commit cd61c60
Showing
5 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{SlackRawMessage, SlackBotMessage, SlackTextMessage} = require '../src/message' | ||
{SlackBotListener, SlackRawListener} = require '../src/listener' | ||
should = require 'should' | ||
|
||
|
||
describe 'Listeners', -> | ||
|
||
it 'Should fail on incorrect message type', -> | ||
callback = (response) -> | ||
matcher = (message) -> message.text.match /Hello/ | ||
|
||
listener = new SlackRawListener(@stubs.robot, matcher, callback) | ||
listener.call().should.be.false | ||
|
||
|
||
it 'Should call a SlackRawListener', -> | ||
callback = (response) -> | ||
matcher = (message) -> message.text.match /Hello/ | ||
|
||
message = new SlackRawMessage(@stubs.user.id, 'Hello world', 'Hello world', {ts: 1234}) | ||
listener = new SlackRawListener(@stubs.robot, matcher, callback) | ||
listener.call(message).should.be.true | ||
|
||
|
||
it 'Should call a SlackBotListener', -> | ||
callback = (response) -> | ||
message = new SlackBotMessage(@stubs.user.id, 'Hello world', 'Hello world', {ts: 1234}) | ||
listener = new SlackBotListener(@stubs.robot, /Hello/, callback) | ||
listener.call(message).should.be.true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters