mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
28 lines
731 B
CoffeeScript
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)
|
|
|