@@ -29,8 +29,10 @@ describe('Bot', function () {
29
29
this . findRoleStub = sandbox . stub ( ) ;
30
30
this . findEmojiStub = sandbox . stub ( ) ;
31
31
irc . Client = ClientStub ;
32
- discord . Client = createDiscordStub ( this . sendMessageStub , this . findUserStub , this . findRoleStub ,
33
- this . findEmojiStub ) ;
32
+ discord . Client = createDiscordStub (
33
+ this . sendMessageStub , this . findUserStub , this . findRoleStub , this . findEmojiStub
34
+ ) ;
35
+
34
36
ClientStub . prototype . say = sandbox . stub ( ) ;
35
37
ClientStub . prototype . send = sandbox . stub ( ) ;
36
38
ClientStub . prototype . join = sandbox . stub ( ) ;
@@ -80,16 +82,16 @@ describe('Bot', function () {
80
82
} ) ;
81
83
82
84
it ( 'should not send messages to discord if the channel isn\'t in the channel mapping' ,
83
- function ( ) {
84
- this . bot . sendToDiscord ( 'user' , '#no-irc' , 'message' ) ;
85
- this . sendMessageStub . should . not . have . been . called ;
86
- } ) ;
85
+ function ( ) {
86
+ this . bot . sendToDiscord ( 'user' , '#no-irc' , 'message' ) ;
87
+ this . sendMessageStub . should . not . have . been . called ;
88
+ } ) ;
87
89
88
90
it ( 'should not send messages to discord if it isn\'t in the channel' ,
89
- function ( ) {
90
- this . bot . sendToDiscord ( 'user' , '#otherirc' , 'message' ) ;
91
- this . sendMessageStub . should . not . have . been . called ;
92
- } ) ;
91
+ function ( ) {
92
+ this . bot . sendToDiscord ( 'user' , '#otherirc' , 'message' ) ;
93
+ this . sendMessageStub . should . not . have . been . called ;
94
+ } ) ;
93
95
94
96
it ( 'should send to a discord channel ID appropriately' , function ( ) {
95
97
const username = 'testuser' ;
@@ -100,23 +102,23 @@ describe('Bot', function () {
100
102
} ) ;
101
103
102
104
it ( 'should not send special messages to discord if the channel isn\'t in the channel mapping' ,
103
- function ( ) {
104
- this . bot . sendExactToDiscord ( '#no-irc' , 'message' ) ;
105
- this . sendMessageStub . should . not . have . been . called ;
106
- } ) ;
105
+ function ( ) {
106
+ this . bot . sendExactToDiscord ( '#no-irc' , 'message' ) ;
107
+ this . sendMessageStub . should . not . have . been . called ;
108
+ } ) ;
107
109
108
110
it ( 'should not send special messages to discord if it isn\'t in the channel' ,
109
- function ( ) {
110
- this . bot . sendExactToDiscord ( '#otherirc' , 'message' ) ;
111
- this . sendMessageStub . should . not . have . been . called ;
112
- } ) ;
111
+ function ( ) {
112
+ this . bot . sendExactToDiscord ( '#otherirc' , 'message' ) ;
113
+ this . sendMessageStub . should . not . have . been . called ;
114
+ } ) ;
113
115
114
116
it ( 'should send special messages to discord' ,
115
- function ( ) {
116
- this . bot . sendExactToDiscord ( '#irc' , 'message' ) ;
117
- this . sendMessageStub . should . have . been . calledWith ( 'message' ) ;
118
- this . debugSpy . should . have . been . calledWith ( 'Sending special message to Discord' , 'message' , '#irc' , '->' , '#discord' ) ;
119
- } ) ;
117
+ function ( ) {
118
+ this . bot . sendExactToDiscord ( '#irc' , 'message' ) ;
119
+ this . sendMessageStub . should . have . been . calledWith ( 'message' ) ;
120
+ this . debugSpy . should . have . been . calledWith ( 'Sending special message to Discord' , 'message' , '#irc' , '->' , '#discord' ) ;
121
+ } ) ;
120
122
121
123
it ( 'should not color irc messages if the option is disabled' , function ( ) {
122
124
const text = 'testmessage' ;
@@ -297,22 +299,22 @@ describe('Bot', function () {
297
299
} ) ;
298
300
299
301
it ( 'should not send messages to irc if the channel isn\'t in the channel mapping' ,
300
- function ( ) {
301
- const guild = createGuildStub ( ) ;
302
- const message = {
303
- channel : {
304
- name : 'wrongdiscord'
305
- } ,
306
- author : {
307
- username : 'otherauthor' ,
308
- id : 'not bot id'
309
- } ,
310
- guild
311
- } ;
312
-
313
- this . bot . sendToIRC ( message ) ;
314
- ClientStub . prototype . say . should . not . have . been . called ;
315
- } ) ;
302
+ function ( ) {
303
+ const guild = createGuildStub ( ) ;
304
+ const message = {
305
+ channel : {
306
+ name : 'wrongdiscord'
307
+ } ,
308
+ author : {
309
+ username : 'otherauthor' ,
310
+ id : 'not bot id'
311
+ } ,
312
+ guild
313
+ } ;
314
+
315
+ this . bot . sendToIRC ( message ) ;
316
+ ClientStub . prototype . say . should . not . have . been . called ;
317
+ } ) ;
316
318
317
319
it ( 'should parse text from discord when sending messages' , function ( ) {
318
320
const text = '<#1234>' ;
0 commit comments