Skip to content

Commit

Permalink
Merge 3fc99b5 into 3b84c6b
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki committed Aug 4, 2016
2 parents 3b84c6b + 3fc99b5 commit 5ad2d92
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/alias_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe 'alias', ->
context 'with placeholders in an alias action', ->
it 'does not replace placeholders', (done)->
sharedExample done, 'hubot alias command=something=$1 other=$2', 'alias command=something=$1 other=$2'

context 'with reverse order placeholders', ->
it 'replaces alias string', (done)->
sharedExample done, 'hubot reverse_params john hello hey', 'goo --name=hey --message=john hello'
Expand Down Expand Up @@ -192,3 +192,14 @@ describe 'alias', ->
done e
adapter.receive new TextMessage(user, "hubot alias bar=")
expect(@brainSetSpy).to.have.been.calledWith sinon.match.string, {foo: 'goo'}

it 'sets alias with placeholders', (done)->
adapter.on "send", (envelope, strings)->
try
expect(strings).to.have.length(1)
expect(strings[0]).to.equal 'I made an alias command for "something=$1 other=$2".'
do done
catch e
done e
adapter.receive new TextMessage(user, "hubot alias command=something=$1 other=$2")
expect(@brainSetSpy).to.have.been.calledWith sinon.match.string, {foo: 'goo', bar: 'par', command: 'something=$1 other=$2'}

0 comments on commit 5ad2d92

Please sign in to comment.