Initialize ~/.atom when config is loaded

Closes #299
This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-02-22 14:35:13 -08:00
parent b04c1ad766
commit fa81871907
2 changed files with 30 additions and 0 deletions

View File

@@ -109,3 +109,20 @@ describe "Config", ->
config.set("foo.bar.baz", "i'm back")
expect(observeHandler).toHaveBeenCalledWith("i'm back")
describe "initializeConfigDirectory()", ->
beforeEach ->
config.configDirPath = '/tmp/dot-atom-dir'
afterEach ->
fs.remove('/tmp/dot-atom-dir') if fs.exists('/tmp/dot-atom-dir')
describe "when the configDirPath doesn't exist", ->
it "copies the contents of dot-atom to ~/.atom if it doesn't exist", ->
expect(fs.exists(config.configDirPath)).toBeFalsy()
config.initializeConfigDirectory()
expect(fs.exists(config.configDirPath)).toBeTruthy()
expect(fs.exists(fs.join(config.configDirPath, 'packages'))).toBeTruthy()
expect(fs.exists(fs.join(config.configDirPath, 'snippets'))).toBeTruthy()
expect(fs.exists(fs.join(config.configDirPath, 'themes'))).toBeTruthy()
expect(fs.isFile(fs.join(config.configDirPath, 'config.cson'))).toBeTruthy()