Files
atom/spec/app/atom-spec.coffee
Nathan Sobo 37f0aa3f90 Replace window.requireExtension with atom.loadPackage
The goal is that `loadPackage` will be the go-to place for loading all kinds of resources out of directories. `requireExtension` was only designed to load and activate extension modules.
2012-12-18 19:47:20 -07:00

15 lines
480 B
CoffeeScript

RootView = require 'root-view'
describe "the `atom` global", ->
describe ".loadPackage(name)", ->
extension = null
beforeEach ->
rootView = new RootView
extension = require "package-with-extension"
it "requires and activates the package's main module if it exists", ->
spyOn(rootView, 'activateExtension').andCallThrough()
atom.loadPackage("package-with-extension")
expect(rootView.activateExtension).toHaveBeenCalledWith(extension)