Add spec for converting CSON back to object

This commit is contained in:
Kevin Sawicki 2013-02-04 08:48:28 -08:00
parent ffc65b3735
commit f65e83fe2a

View File

@ -65,3 +65,18 @@ describe "CSON", ->
it "returns formatted CSON", ->
expect(CSON.stringify(a: {b: 'c'})).toBe "'a':\n 'b': 'c'"
describe "when converting back to an object", ->
it "produces the original object", ->
object =
showInvisibles: true
fontSize: 20
core:
themes: ['a', 'b']
stripTrailingWhitespace:
singleTrailingNewline: true
cson = CSON.stringify(object)
{CoffeeScript} = require 'coffee-script'
evaledObject = CoffeeScript.eval(cson, bare: true)
expect(evaledObject).toEqual object