   hash = new Batman.Hash
     'backgroundColor': 'blue'
     color: 'green'
-  context = Batman hash: hash
-  helpers.render source, context, (node) ->
+
+  helpers.render source, {hash}, (node, view) ->
     node = node[0]
     equal node.style['backgroundColor'], 'blue'
     equal node.style['color'], 'green'
 
-    context.set 'hash', new Batman.Hash color: 'red'
+    view.set('hash', new Batman.Hash color: 'red')
     equal node.style['backgroundColor'], ''
     equal node.style['color'], 'red'
 


asyncTest 'data-bind-style should bind to a vanilla object', 4, ->
  source = '<input type="text" data-bind-style="object"></input>'
  context = Batman
    object:
      backgroundColor: 'blue'
      color: 'green'

  helpers.render source, context, (node) ->
    node = node[0]
    equal node.style['backgroundColor'], 'blue'
    equal node.style['color'], 'green'
    context.set 'object', {color: 'red'}
    equal node.style['backgroundColor'], ''
    equal node.style['color'], 'red'



asyncTest 'data-bind-style should bind to a Batman object', ->
  source = '<input type="text" data-bind-style="object"></input>'
  context =
    object: new Batman.Object
      'backgroundColor': 'blue'
      color: 'green'

  helpers.render source, context, (node, view) ->
    node = node[0]
    equal node.style['backgroundColor'], 'blue'
    equal node.style['color'], 'green'

    view.set('object.color', 'blue')
    equal node.style['color'], 'blue'
    equal node.style['backgroundColor'], 'blue'

    view.unset('object.color')
    equal node.style['color'], ''
    equal node.style['backgroundColor'], 'blue'

    view.set('object', new Batman.Object color: 'yellow')
    equal node.style['color'], 'yellow'
    equal node.style['backgroundColor'], ''

