mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add Project.open, which returns a buffer for an absolute/relative path.
This commit is contained in:
@@ -14,3 +14,16 @@ describe "Project", ->
|
||||
project.getFilePaths().done (result) ->
|
||||
expect(result).toEqual(expectedPaths)
|
||||
|
||||
describe ".open(path)", ->
|
||||
absolutePath = null
|
||||
beforeEach ->
|
||||
absolutePath = require.resolve('fixtures/dir/a')
|
||||
|
||||
describe "when given an absolute path", ->
|
||||
it "returns a buffer for the given path", ->
|
||||
expect(project.open(absolutePath).url).toBe absolutePath
|
||||
|
||||
describe "when given a relative path", ->
|
||||
it "returns a buffer for the given path (relative to the project root)", ->
|
||||
expect(project.open('a').url).toBe absolutePath
|
||||
|
||||
|
||||
Reference in New Issue
Block a user