Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (26 sloc) 0.739 kB
readenv = require "../src/components/ReadGroup"
socket = require "../src/lib/InternalSocket"
setupComponent = ->
c = readenv.getComponent()
ins = socket.createSocket()
group = socket.createSocket()
c.inPorts.in.attach ins
c.outPorts.group.attach group
[c, ins, group]
exports['test reading a group'] = (test) ->
test.expect 1
[c, ins, group] = setupComponent()
group.once 'data', (data) ->
test.equal data, 'foo'
test.done()
ins.beginGroup 'foo'
ins.send 'hello'
exports['test reading a subgroup'] = (test) ->
test.expect 1
[c, ins, group] = setupComponent()
group.once 'data', (data) ->
test.equal data, 'foo:bar'
test.done()
ins.beginGroup 'foo'
ins.beginGroup 'bar'
ins.send 'hello'
Jump to Line
Something went wrong with that request. Please try again.