         atom.workspaceView.trigger 'minimap:toggle-dummy'
 
       it 'should have received a deactivation call', ->
-        expect(@plugin.deactivatePlugin).toHaveBeenCalled()
+        expect(plugin.deactivatePlugin).toHaveBeenCalled()
 
     describe 'and then unregistered', ->
       beforeEach ->

{WorkspaceView} = require 'atom'

describe "Minimap Plugins", ->
  beforeEach ->
    runs ->
      atom.workspaceView = new WorkspaceView

          atom.config.set 'minimap.plugins.dummy', false

        it 'should not receive an activation call', ->
          expect(plugin.deactivatePlugin).not.toHaveBeenCalled()

  describe 'the registered plugin', ->
    it 'should have received an activation call', ->
      Minimap.registerPlugin 'dummy', plugin
      expect(plugin.activatePlugin).toHaveBeenCalled()

    describe 'when the config for it is false', ->
      beforeEach ->
        atom.config.set 'minimap.plugins.dummy', false
        Minimap.registerPlugin 'dummy', plugin

      it 'should not have received an activation call', ->
        expect(plugin.activatePlugin).not.toHaveBeenCalled()

    describe 'when the config is modified after registration', ->
      beforeEach ->
        Minimap.registerPlugin 'dummy', plugin
        atom.config.set 'minimap.plugins.dummy', false

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

  describe 'on minimap activation', ->
    beforeEach ->
