       atom.config.set 'minimap.displayPluginsControls', true
       atom.config.set 'minimap.plugins.dummy', undefined
 
-    @plugin =
+    plugin =
       active: false
       activatePlugin: -> @active = true
       deactivatePlugin: -> @active = false
       isActive: -> @active
 
-    spyOn(@plugin, 'activatePlugin').andCallThrough()
-    spyOn(@plugin, 'deactivatePlugin').andCallThrough()
+    spyOn(plugin, 'activatePlugin').andCallThrough()
+    spyOn(plugin, 'deactivatePlugin').andCallThrough()
 
     @registerHandler = jasmine.createSpy('register handler')
     @unregisterHandler = jasmine.createSpy('unregister handler')

        atom.workspaceView.trigger 'minimap:toggle-dummy'

      it 'should have received a deactivation call', ->
        expect(@plugin.deactivatePlugin).toHaveBeenCalled()

    describe 'and then unregistered', ->
      beforeEach ->


    beforeEach ->
      Minimap.onDidAddPlugin @registerHandler
      Minimap.registerPlugin 'dummy', plugin

    it 'should be available in the minimap', ->
      expect(Minimap.plugins['dummy']).toBe(plugin)

    it 'should have emit an event', ->
      expect(@registerHandler).toHaveBeenCalled()
