mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Add spec for converting CSON back to object
This commit is contained in:
parent
ffc65b3735
commit
f65e83fe2a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user