diff --git a/spec/atom/root-view-spec.coffee b/spec/atom/root-view-spec.coffee index 706865e7e..32219572e 100644 --- a/spec/atom/root-view-spec.coffee +++ b/spec/atom/root-view-spec.coffee @@ -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 diff --git a/src/atom/root-view.coffee b/src/atom/root-view.coffee index e198fd174..e56fc7c38 100644 --- a/src/atom/root-view.coffee +++ b/src/atom/root-view.coffee @@ -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 = $('
')