 
 
   describe "#previousSiblings('css-rule')", ->
-
-    it "should return a list of all the next siblings when called without a css-rule", get '#three .three', (element, $, window, document)->
+    element = get('#three .three')
+
+    it "should return a list of all the next siblings when called without a css-rule", ->
       siblings = element.previousSiblings()
 
       siblings.should.be.instanceOf    $.NodeList

      siblings[0]._.should.equal       document.querySelector('#three .two')
      siblings[1]._.should.equal       document.querySelector('#three .three')

    it "should return only matching siblings when called with a css-rule", get '#three .one', (element, $, window, document)->
      siblings = element.nextSiblings('.two')

      siblings.should.be.instanceOf    $.NodeList

  """

describe "Element Navigation", ->

  $ = window = document = element = null

  get = (css_rule)->
    before Test.load module, "/navigation.html", (dom, win)->
      $        = dom
      window   = win
      document = win.document
      element  = new $.Element(window.document.querySelector(css_rule))


  describe "#match('css_rule')", ->
    element = get('#one .one')

    it "should say 'true' if it match the rule", ->
      element.match('#one .one').should.be.true

    it "should say 'false' if it doesn't match the rule", ->
      element.match('#one .two').should.be.false

  describe "#find('css_rule')", ->
    element = get('#one')

    it "should search in the element", ->
      search = element.find('.one')

      search.should.be.instanceOf    $.NodeList
