Use package instead of package's view in specs

Event logs are now stored on the package and passed
to the view when toggled.
This commit is contained in:
Kevin Sawicki
2013-01-31 09:32:20 -08:00
parent 4f8181969e
commit ef6e525674

View File

@@ -6,9 +6,8 @@ describe "CommandLogger", ->
beforeEach ->
rootView = new RootView(require.resolve('fixtures/sample.js'))
atom.loadPackage('command-logger').getInstance()
commandLogger = atom.loadPackage('command-logger')
editor = rootView.getActiveEditor()
commandLogger = CommandLogger.instance
afterEach ->
rootView.deactivate()
@@ -44,9 +43,11 @@ describe "CommandLogger", ->
describe "when an event is ignored", ->
it "does not create a node for that event", ->
commandLogger.ignoredEvents.push 'editor:delete-line'
commandLoggerView = commandLogger.getInstance()
commandLoggerView.ignoredEvents.push 'editor:delete-line'
editor.trigger 'editor:delete-line'
nodes = commandLogger.createNodes()
commandLoggerView.eventLog = commandLogger.eventLog
nodes = commandLoggerView.createNodes()
for node in nodes
continue unless node.name is 'Editor'
for child in node.children