 
         it 'adds an up-keep attribute to the fragment during compilation', ->
 
-          up.$compiler '.foo', { keep: true }, ->
-          up.$compiler '.bar', { }, ->
-          up.$compiler '.bar', { keep: false }, ->
-          up.$compiler '.bam', { keep: '.partner' }, ->
+          up.compiler '.foo', { keep: true }, ->
+          up.compiler '.bar', { }, ->
+          up.compiler '.bar', { keep: false }, ->
+          up.compiler '.bam', { keep: '.partner' }, ->
 
           $foo = $ up.hello(affix('.foo'))
           $bar = $ up.hello(affix('.bar'))


  describe 'JavaScript functions', ->
  
    describe 'up.$compiler', ->
      
      it 'applies an event initializer whenever a matching fragment is inserted', ->
  
        observeClass = jasmine.createSpy()
        up.$compiler '.child', ($element) ->
          observeClass($element.attr('class'))
  
        up.hello(affix('.container .child'))
   
        expect(observeClass).not.toHaveBeenCalledWith('container')
        expect(observeClass).toHaveBeenCalledWith('child')

      describe 'destructors', ->

        it 'allows compilers to return a function to call when the compiled element is destroyed', asyncSpec (next) ->
          destructor = jasmine.createSpy('destructor')
          up.$compiler '.child', ($element) ->
            destructor

          up.hello(affix('.container .child'))

          next =>
            expect(destructor).not.toHaveBeenCalled()


        it 'runs all destructors if multiple compilers are applied to the same element', asyncSpec (next) ->
          destructor1 = jasmine.createSpy('destructor1')
          up.compiler '.one', (element) -> destructor1
          destructor2 = jasmine.createSpy('destructor2')
          up.compiler '.two', (element) -> destructor2

          $element = affix('.one.two')
          up.hello($element)
