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.
This commit is contained in:
Jeremy Ramin
2015-08-24 16:08:43 -07:00
parent 9a0d657d52
commit 1de707f2d7

View File

@@ -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'