Extend AtomPackage directly in packages index.coffee

This commit is contained in:
Kevin Sawicki
2013-01-22 08:56:18 -08:00
parent 36e0ad6dc8
commit ca596db310
43 changed files with 252 additions and 175 deletions

View File

@@ -1,5 +1,6 @@
RootView = require 'root-view'
{$$} = require 'space-pen'
Package = require 'package'
describe "the `atom` global", ->
describe ".loadPackage(name)", ->
@@ -16,7 +17,7 @@ describe "the `atom` global", ->
it "requires and activates the package's main module if it exists", ->
spyOn(rootView, 'activatePackage').andCallThrough()
atom.loadPackage("package-with-module")
expect(rootView.activatePackage).toHaveBeenCalledWith('package-with-module', extension)
expect(rootView.activatePackage).toHaveBeenCalled()
it "logs warning instead of throwing an exception if a package fails to load", ->
spyOn(console, "warn")

View File

@@ -1,3 +1,6 @@
AtomPackage = require 'atom-package'
module.exports =
class MyPackage extends AtomPackage
activate: ->
@activateCalled = true