wii - gettings specs on App.open. Window closing not working quite right.

This commit is contained in:
Corey Johnson
2011-12-14 16:24:30 -08:00
parent 507341e714
commit fbb3efacf4
15 changed files with 144 additions and 68 deletions

View File

@@ -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
View File

@@ -0,0 +1 @@
Some text.

View 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()

View File

@@ -1,2 +1,4 @@
require 'template-spec'
require 'atom/app-spec'
require 'stdlib/template-spec'