Add specs for setting with an object

This commit is contained in:
Kevin Sawicki 2015-01-08 15:50:10 -08:00
parent c480080dd2
commit fc899f54cf

View File

@ -1309,6 +1309,10 @@ describe "Config", ->
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 0, green: 255, blue: 0, alpha: 1}
atom.config.set('foo.bar.aColor', 'hsla(120,100%,50%,0.3)')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 0, green: 255, blue: 0, alpha: .3}
atom.config.set('foo.bar.aColor', {red: 100, green: 255, blue: 2, alpha: .5})
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 100, green: 255, blue: 2, alpha: .5}
atom.config.set('foo.bar.aColor', {red: 255})
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 0, blue: 0, alpha: 1}
it 'reverts back to the default value when undefined is passed to set', ->
atom.config.set('foo.bar.aColor', 'rgb(255,255,255)')