Skip to content

Commit

Permalink
Processing function called with port as context
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kan committed Mar 2, 2014
1 parent 5ca06ee commit f888e4d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/InPort.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ describe 'Inport Port', ->
it 'should not contain a socket initially', ->
chai.expect(p.sockets.length).to.equal 0

describe 'with processing function called with port as context', ->
it 'should set context to port itself', ->
s = new socket
p = new inport
p.on 'data', (packet, outPorts) ->
chai.expect(this).toBe p
chai.expect(packet).toEqual 'some-data'
p.attach s
s.send 'some-data'

describe 'with default value', ->
p = s = null
beforeEach ->
Expand Down

0 comments on commit f888e4d

Please sign in to comment.