mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
WIP Add test for ensuring that set/unset operations take place after load
This commit is contained in:
parent
a0766d9b69
commit
494cb7ea4b
@ -1756,3 +1756,34 @@ describe "Config", ->
|
||||
|
||||
expect(atom.config.set('foo.bar.str_options', 'One')).toBe false
|
||||
expect(atom.config.get('foo.bar.str_options')).toEqual 'two'
|
||||
describe "when .set/.unset is called prior to .loadUserConfig", ->
|
||||
console.log 'this test'
|
||||
beforeEach ->
|
||||
fs.writeFileSync config.configFilePath, """
|
||||
'*':
|
||||
foo:
|
||||
bar: 'baz'
|
||||
do:
|
||||
ray: 'me'
|
||||
"""
|
||||
|
||||
it "ensures that all settings are loaded correctly", ->
|
||||
console.log 'test start'
|
||||
config.unset('foo.bar')
|
||||
expect(config.save).not.toHaveBeenCalled()
|
||||
config.set('foo.qux', 'boo')
|
||||
expect(config.save).not.toHaveBeenCalled()
|
||||
expect(config.get('foo.qux')).toBeUndefined()
|
||||
expect(config.get('do.ray')).toBeUndefined()
|
||||
|
||||
console.log 'loadUserConfig'
|
||||
config.loadUserConfig()
|
||||
|
||||
waitsFor -> config.get('foo.bar') is undefined
|
||||
runs ->
|
||||
expect(config.save).toHaveBeenCalled()
|
||||
expect(config.get('foo.bar')).toBeUndefined()
|
||||
expect(config.get('foo.qux')).toBe('boo')
|
||||
expect(config.get('do.ray')).toBe('me')
|
||||
|
||||
console.log 'end test'
|
||||
|
Loading…
Reference in New Issue
Block a user