pulsar/spec/atom/app-spec.coffee
Corey Johnson & Nathan Sobo b5b1ac67fa Remove slow specs
2012-01-05 11:20:18 -08:00

28 lines
731 B
CoffeeScript

App = require 'app'
fs = require 'fs'
describe "App", ->
app = null
beforeEach ->
app = new App()
afterEach ->
window.close() for window in app.windows()
waitsFor ->
app.windows().length == 0
describe "open", ->
describe "when opening a filePath", ->
it "displays it in a new window with the contents of the file loaded", ->
filePath = require.resolve 'fixtures/sample.txt'
expect(app.windows().length).toBe 0
app.open filePath
expect(app.windows().length).toBe 1
newWindow = app.windows()[0]
expect(newWindow.rootView.editor.buffer.url).toEqual filePath
expect(newWindow.rootView.editor.buffer.getText()).toEqual fs.read(filePath)