From 1de707f2d7fe54ef772a796e60169b24ad866415 Mon Sep 17 00:00:00 2001 From: Jeremy Ramin Date: Mon, 24 Aug 2015 16:08:43 -0700 Subject: [PATCH] :white_check_mark: Add tests to config spec Add tests to check if the get command properly merges the stored values with the defined defaults in the schema. Two cases: - Obj has no property changes. - Obj has one or more changes to a property. --- spec/config-spec.coffee | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index 3b7bd6061..23541bfb5 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -1110,6 +1110,24 @@ describe "Config", -> nestedObject: superNestedInt: 36 + expect(atom.config.get("foo")).toEqual { + bar: + anInt: 12 + anObject: + nestedInt: 24 + nestedObject: + superNestedInt: 36 + } + atom.config.set("foo.bar.anObject.nestedObject.superNestedInt", 37) + expect(atom.config.get("foo")).toEqual { + bar: + anInt: 12 + anObject: + nestedInt: 24 + nestedObject: + superNestedInt: 37 + } + it 'can set a non-object schema', -> schema = type: 'integer'