mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
wii - gettings specs on App.open. Window closing not working quite right.
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
App = require 'views/app'
|
||||
App = require 'app'
|
||||
|
||||
describe "App", ->
|
||||
view = null
|
||||
app = null
|
||||
|
||||
beforeEach ->
|
||||
view = App.buildView()
|
||||
app = new App()
|
||||
|
||||
afterEach ->
|
||||
window.x = app.windows()[0]
|
||||
setTimeout (-> window.x.close()), 1
|
||||
#w.close() for w in app.windows()
|
||||
|
||||
describe "open", ->
|
||||
it "loads a buffer based on the given path and displays it in a new window", ->
|
||||
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.editor.buffer.url).toEqual filePath
|
||||
|
||||
1
spec/fixtures/sample.txt
vendored
Normal file
1
spec/fixtures/sample.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Some text.
|
||||
24
spec/spec-bootstrap.coffee
Normal file
24
spec/spec-bootstrap.coffee
Normal file
@@ -0,0 +1,24 @@
|
||||
nakedLoad 'jasmine'
|
||||
nakedLoad 'jasmine-html'
|
||||
|
||||
$ = require 'jquery'
|
||||
coffeekup = require 'coffeekup'
|
||||
|
||||
$('head').append coffeekup.render ->
|
||||
link rel: "stylesheet", type: "text/css", href: "static/jasmine.css"
|
||||
|
||||
$('body').append coffeekup.render ->
|
||||
div id: 'jasmine_runner'
|
||||
div id: 'jasmine_content'
|
||||
|
||||
jasmineEnv = jasmine.getEnv()
|
||||
trivialReporter = new jasmine.TrivialReporter(document, 'jasmine_runner')
|
||||
|
||||
jasmineEnv.addReporter(trivialReporter)
|
||||
|
||||
jasmineEnv.specFilter = (spec) ->
|
||||
return trivialReporter.specFilter(spec)
|
||||
|
||||
require 'spec-suite'
|
||||
jasmineEnv.execute()
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
require 'template-spec'
|
||||
require 'atom/app-spec'
|
||||
|
||||
require 'stdlib/template-spec'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user