From 16c7fd3d70c8aa09869ac9be6a297bef7c45fac2 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Mon, 29 Sep 2014 15:13:13 -0700 Subject: [PATCH] Add spec for update event on load --- spec/config-spec.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index 703c037cb..3d7d3de1e 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -359,11 +359,19 @@ describe "Config", -> describe "when the config file contains valid cson", -> beforeEach -> fs.writeFileSync(atom.config.configFilePath, "foo: bar: 'baz'") - atom.config.loadUserConfig() it "updates the config data based on the file contents", -> + atom.config.loadUserConfig() expect(atom.config.get("foo.bar")).toBe 'baz' + it "notifies observers for updated keypaths on load", -> + observeHandler = jasmine.createSpy("observeHandler") + observeSubscription = atom.config.observe "foo.bar", observeHandler + + atom.config.loadUserConfig() + + expect(observeHandler).toHaveBeenCalledWith 'baz' + describe "when the config file contains invalid cson", -> beforeEach -> spyOn(console, 'error')