     hx.select('#grandchild').closest('#thing-that-doesnt-exist').empty().should.equal(true)
 
   it 'closest should warn when you give a non string argument', ->
-    consoleWarning = chai.spy.on(hx, 'consoleWarning')
+    hx.consoleWarning = chai.spy()
 
     obj = {}
 
     hx.select('#fixture').closest(obj)
-    consoleWarning.should.have.been.called.with('Selection.closest was passed the wrong argument type', 'Selection.closest only accepts a string argument, you supplied:', obj)
+    hx.consoleWarning.should.have.been.called.with('Selection.closest was passed the wrong argument type', 'Selection.closest only accepts a string argument, you supplied:', obj)
 
   it 'closest should warn when you give a non string argument', ->
     hx.select('#fixture').closest('potato').empty().should.equal(true)

    hx.select('#fixture').selectAll('span').style('display', 'block').style('display')
    hx.select('#fixture').select('span').style('display', 'inline-block').style('display')

    consoleWarn = chai.spy.on(console, 'warn')

  afterEach ->
    hx.select('#fixture').remove()

describe 'Selection Api', ->
  beforeEach ->
    fixture = hx.select('body').append('div').attr('id', 'fixture').html """
      <div class="wrapper">
