 
 asyncTest 'it should update the whole set of nodes if the collection changes', ->
   source = '<p data-foreach-object="objects" class="present" data-bind="object"></p>'
-  context = new Batman.Object
-    objects: new Batman.Set('foo', 'bar', 'baz')
+  context = {objects: new Batman.Set('foo', 'bar', 'baz')}
+
   Batman.developer.suppress()
   helpers.render source, false, context, (node, view) ->
     equal $('.present', node).length, 3
-    context.set('objects', new Batman.Set('qux', 'corge'))
+    view.set('objects', new Batman.Set('qux', 'corge'))
     delay =>
       equal $('.present', node).length, 2
-      context.set('objects', null)
+      view.set('objects', null)
       delay =>
         equal $('.present', node).length, 0
-        context.set('objects', new Batman.Set('mario'))
+        view.set('objects', new Batman.Set('mario'))
         delay 60, =>
           equal $('.present', node).length, 1
           Batman.developer.unsuppress()
 
 asyncTest 'it should not fail if the collection is cleared', ->
   source = '<p data-foreach-object="objects" class="present" data-bind="object"></p>'
-  context = new Batman.Object
-    objects: new Batman.Set('foo', 'bar', 'baz')
+  context = {objects: new Batman.Set('foo', 'bar', 'baz')}
 
   helpers.render source, false, context, (node, view) ->
     equal $('.present', node).length, 3
-    context.get('objects').clear()
+    view.get('objects').clear()
     delay =>
       equal $('.present', node).length, 0
 
 asyncTest 'it should not fail if the iterator is killed', 1, ->
   source = '<p data-foreach-object="objects" class="present" data-bind="object"></p>'
-  context = new Batman.Object
-    objects: new Batman.Set([0...100]...)
+  context = {objects: new Batman.Set([0...100]...)}
 
   oldIterator = Batman.DOM.IteratorBinding
   instance = false

  Batman.DOM.AbstractBinding::die = ->
    dieVals.push [@key, @node.innerHTML] if @key is 'item.id'

  context = new Batman
  helpers.render source, context
  , (node) ->
    context.set 'items', new Batman.Set({id: 4}, {id: 5}, {id: 6})
    context.set 'items', new Batman.Set({id: 7}, {id: 8}, {id: 9})
    delay ->
      deepEqual dieVals, [['item.id', '4'], ['item.id', '5'], ['item.id', '6']]

asyncTest 'previously observed collections shouldn\'t have any effect if they are replaced', ->
  source = '<p data-foreach-object="objects" class="present" data-bind="object"></p>'
  oldObjects = new Batman.Set('foo', 'bar', 'baz')
  context = {objects: oldObjects}

  helpers.render source, false, context, (node, view) ->
    view.set('objects', new Batman.Set('qux', 'corge'))
    oldObjects.add('no effect')
    delay =>
      equal $('.present', node).length, 2
