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.723 kB
readenv = require "../src/components/ReadGroup"
socket = require "../src/lib/InternalSocket"
setupComponent = ->
c = readenv.getComponent()
ins = socket.createSocket()
out = socket.createSocket()
c.inPorts.in.attach ins
c.outPorts.out.attach out
[c, ins, out]
exports['test reading a group'] = (test) ->
test.expect 1
[c, ins, out] = setupComponent()
out.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, out] = setupComponent()
out.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.