mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Add object to default value spec
This commit is contained in:
@@ -36,13 +36,21 @@ describe "Config", ->
|
||||
|
||||
describe "when the value equals the default value", ->
|
||||
it "does not store the value", ->
|
||||
atom.config.setDefaults("foo", same: 1, changes: 1, sameArray: [1, 2, 3], null: null, undefined: undefined)
|
||||
atom.config.setDefaults "foo",
|
||||
same: 1
|
||||
changes: 1
|
||||
sameArray: [1, 2, 3]
|
||||
sameObject: {a: 1, b: 2}
|
||||
null: null
|
||||
undefined: undefined
|
||||
|
||||
expect(atom.config.settings.foo).toBeUndefined()
|
||||
atom.config.set('foo.same', 1)
|
||||
atom.config.set('foo.changes', 2)
|
||||
atom.config.set('foo.sameArray', [1, 2, 3])
|
||||
atom.config.set('foo.null', undefined)
|
||||
atom.config.set('foo.undefined', null)
|
||||
atom.config.set('foo.sameObject', {b: 2, a: 1})
|
||||
expect(atom.config.settings.foo).toEqual {changes: 2}
|
||||
|
||||
atom.config.set('foo.changes', 1)
|
||||
|
||||
Reference in New Issue
Block a user