Only notify when changed key path is really sub path of observed path

Closes #3775
This commit is contained in:
Ben Ogle
2014-10-13 14:25:55 -07:00
parent 9481260f6f
commit 0588e14850
2 changed files with 18 additions and 4 deletions

View File

@@ -340,6 +340,14 @@ describe "Config", ->
atom.config.set('foo.bar.baz', "value 2")
expect(observeHandler).not.toHaveBeenCalled()
it 'does not fire the callback for a similarly named keyPath', ->
bazCatHandler = jasmine.createSpy("bazCatHandler")
observeSubscription = atom.config.observe "foo.bar.bazCat", bazCatHandler
bazCatHandler.reset()
atom.config.set('foo.bar.baz', "value 10")
expect(bazCatHandler).not.toHaveBeenCalled()
describe ".initializeConfigDirectory()", ->
beforeEach ->
if fs.existsSync(dotAtomPath)