Skip to content

Commit

Permalink
test pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
dodo committed Nov 9, 2013
1 parent ecd47ac commit 4b4c9b4
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions src/test/render.coffee
@@ -1,9 +1,39 @@
{ Template } = require '../dynamictemplate'
render = require '../render'
{ render, pipe } = require '../render'


module.exports =

pipe: (æ) ->
output = pipe new Template schema:5, doctype:on, ->
@$html ->
@$head ->
@$title "holla"
@$body ->
@$p "hello world"


output.on 'data', (tag) -> æ.equal results.shift(), tag.toString()
output.on 'end', ->
æ.equal 0, results.length
æ.done()
results = [
'<!DOCTYPE html>'
'<html>'
'<head>'
'<title>'
'holla'
'</title>'
'</head>'
'<body>'
'<p>'
'hello world'
'</p>'
'</body>'
'</html>'
]


simple: (æ) ->
output = render new Template schema:5, doctype:on, ->
@$html ->
Expand Down Expand Up @@ -31,4 +61,4 @@ module.exports =
'</p>'
'</body>'
'</html>'
]
]

0 comments on commit 4b4c9b4

Please sign in to comment.