                                 li = @$li({'data-content':data}, data)
                         @end()
 
-
-        xml.ready æ.done
         xml.stream.on 'data', (tag) -> æ.equal results.shift(), tag
+        xml.stream.on 'end', ->
+            æ.equal 0, results.length
+            æ.done()
         results = [
             '<!DOCTYPE html>'
             '<html>'

            title:'test'
            content:'..'

        xml.ready æ.done
        xml.stream.on 'data', (tag) -> æ.equal results.shift(), tag
        results = [
            '<html>'
            '<head>'

            ' </body>\n'
            '</html>\n'
        ]


    layout: (æ) ->

