This commit is contained in:
Nathan Sobo
2012-01-04 19:08:23 -07:00
parent 629c1ef239
commit 1689824ad7
2 changed files with 4 additions and 9 deletions

View File

@@ -17,8 +17,8 @@ describe "RootView", ->
expect(rootView.editor.buffer.url).toBe url
describe "when called with a url that references a directory", ->
it "creates a project for the directory and opens and empty buffer", ->
url = require.resolve 'fixtures/dir'
it "creates a project for the directory and opens an empty buffer", ->
url = require.resolve 'fixtures/dir/'
rootView = RootView.build {url}
expect(rootView.project.url).toBe url

View File

@@ -21,14 +21,9 @@ class RootView extends Template
@bindKey 'meta+w', => window.close()
@bindKey 'meta+t', => @toggleFileFinder()
if not url
# not sure what to do
else if fs.isDirectory url
@project = new Project url
@editor.open()
else
if url
@project = new Project(fs.directory(url))
@editor.open url
@editor.open(url) if fs.isFile(url)
addPane: (view) ->
pane = $('<div class="pane">')