diff options
author | Thom Williams <thom.williams@pnnl.gov> | 2016-08-19 13:28:03 -0700 |
---|---|---|
committer | Thom Williams <thom.williams@pnnl.gov> | 2016-08-19 13:28:03 -0700 |
commit | f40cecc8aa983a2f4d61406ca23a7e80020ac55e (patch) | |
tree | 8474820a55340c45e41e390e534bf3ffb9ebae89 | |
parent | ca83acf0b806f6561ac96e34bfa913fc83e5586d (diff) | |
download | yamljs-f40cecc8aa983a2f4d61406ca23a7e80020ac55e.tar.gz |
Add test for empty objects
-rw-r--r-- | test/spec/YamlSpec.coffee | 3 | ||||
-rw-r--r-- | test/spec/YamlSpec.js | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/test/spec/YamlSpec.coffee b/test/spec/YamlSpec.coffee index 0d0f613..5b94cee 100644 --- a/test/spec/YamlSpec.coffee +++ b/test/spec/YamlSpec.coffee @@ -934,7 +934,10 @@ describe 'Dumped YAML Inline Collections', -> expect YAML.parse(YAML.dump({key:[]})) .toEqual({key:[]}) + it 'can be dumpted empty inline collections', -> + expect YAML.parse(YAML.dump({key:{}})) + .toEqual({key:{}}) describe 'Dumped YAML Basic Types', -> diff --git a/test/spec/YamlSpec.js b/test/spec/YamlSpec.js index feac414..05ddab5 100644 --- a/test/spec/YamlSpec.js +++ b/test/spec/YamlSpec.js @@ -481,13 +481,20 @@ describe('Dumped YAML Inline Collections', function() { } }))); }); - return it('can be dumped empty sequences in mappings', function() { + it('can be dumped empty sequences in mappings', function() { return expect(YAML.parse(YAML.dump({ key: [] }))).toEqual({ key: [] }); }); + return it('can be dumpted empty inline collections', function() { + return expect(YAML.parse(YAML.dump({ + key: {} + }))).toEqual({ + key: {} + }); + }); }); describe('Dumped YAML Basic Types', function() { |