mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
🔥 ncp; use fs.copySync
This commit is contained in:
parent
30bd85d8cc
commit
ac78cee584
@ -26,7 +26,6 @@
|
|||||||
"harmony-collections": "~0.3.8",
|
"harmony-collections": "~0.3.8",
|
||||||
"legal-eagle": "~0.9.0",
|
"legal-eagle": "~0.9.0",
|
||||||
"minidump": "~0.8",
|
"minidump": "~0.8",
|
||||||
"ncp": "^1.0.1",
|
|
||||||
"npm": "~1.4.5",
|
"npm": "~1.4.5",
|
||||||
"rcedit": "~0.3.0",
|
"rcedit": "~0.3.0",
|
||||||
"request": "~2.27.0",
|
"request": "~2.27.0",
|
||||||
|
@ -8,7 +8,6 @@ BufferedProcess = require '../src/buffered-process'
|
|||||||
{Directory} = require 'pathwatcher'
|
{Directory} = require 'pathwatcher'
|
||||||
GitRepository = require '../src/git-repository'
|
GitRepository = require '../src/git-repository'
|
||||||
temp = require "temp"
|
temp = require "temp"
|
||||||
{ncp} = require "../build/node_modules/ncp"
|
|
||||||
|
|
||||||
describe "Project", ->
|
describe "Project", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@ -235,29 +234,18 @@ describe "Project", ->
|
|||||||
directory2 = temp.mkdirSync("git-repo1")
|
directory2 = temp.mkdirSync("git-repo1")
|
||||||
directory3 = temp.mkdirSync("git-repo2")
|
directory3 = temp.mkdirSync("git-repo2")
|
||||||
|
|
||||||
waitsFor (done) ->
|
gitDirPath = fs.absolute(path.join(__dirname, 'fixtures', 'git', 'master.git'))
|
||||||
ncp(
|
fs.copySync(gitDirPath, path.join(directory2, ".git"))
|
||||||
fs.absolute(path.join(__dirname, 'fixtures', 'git', 'master.git')),
|
fs.copySync(gitDirPath, path.join(directory3, ".git"))
|
||||||
path.join(directory2, ".git"),
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
waitsFor (done) ->
|
atom.project.setPaths([directory1, directory2, directory3])
|
||||||
ncp(
|
|
||||||
fs.absolute(path.join(__dirname, 'fixtures', 'git', 'master.git')),
|
|
||||||
path.join(directory3, ".git"),
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
runs ->
|
[repo1, repo2, repo3] = atom.project.getRepositories()
|
||||||
atom.project.setPaths([directory1, directory2, directory3])
|
expect(repo1).toBeNull()
|
||||||
|
expect(repo2.getShortHead()).toBe "master"
|
||||||
[repo1, repo2, repo3] = atom.project.getRepositories()
|
expect(repo2.getPath()).toBe fs.realpathSync(path.join(directory2, ".git"))
|
||||||
expect(repo1).toBeNull()
|
expect(repo3.getShortHead()).toBe "master"
|
||||||
expect(repo2.getShortHead()).toBe "master"
|
expect(repo3.getPath()).toBe fs.realpathSync(path.join(directory3, ".git"))
|
||||||
expect(repo2.getPath()).toBe fs.realpathSync(path.join(directory2, ".git"))
|
|
||||||
expect(repo3.getShortHead()).toBe "master"
|
|
||||||
expect(repo3.getPath()).toBe fs.realpathSync(path.join(directory3, ".git"))
|
|
||||||
|
|
||||||
it "calls callbacks registered with ::onDidChangePaths", ->
|
it "calls callbacks registered with ::onDidChangePaths", ->
|
||||||
onDidChangePathsSpy = jasmine.createSpy('onDidChangePaths spy')
|
onDidChangePathsSpy = jasmine.createSpy('onDidChangePaths spy')
|
||||||
|
Loading…
Reference in New Issue
Block a user