Permalink
Browse files

Spec for list nested under hash

  • Loading branch information...
tj committed Feb 25, 2010
1 parent a14d932 commit 4d705025385c40b31bca2939dfb43b16ee54144c
Showing with 12 additions and 18 deletions.
  1. +1 −1 Readme.md
  2. +0 −16 spec/fixtures/config.yml
  3. +3 −0 spec/fixtures/hash.list.yml
  4. +8 −1 spec/spec.core.js
View
@@ -1,7 +1,7 @@
# YAML
-CommonJS YAML parser, fast and tiny. Although this implementation
+CommonJS JavaScript YAML parser, fast and tiny. Although this implementation
does not currently support the entire YAML specification, feel free to
fork the project and submit a patch :)
View
@@ -1,16 +0,0 @@
----
- # just a comment
- list: ['foo', 'bar']
- hash: { foo: "bar", n: 1 }
- lib:
- - lib/cart.js
- - lib/cart.foo.js
- specs:
- - spec/cart.spec.js
- - spec/cart.foo.spec.js
- # - Commented out
- environments:
- all:
- options:
- failuresOnly: true
- verbose: false
@@ -0,0 +1,3 @@
+pets:
+ - "niko"
+ - "simon"
View
@@ -34,7 +34,7 @@ describe 'yaml'
describe 'key: val'
it 'should convert to an object'
- var doc = yaml.eval('a: 1\nb: 2\n')
+ var doc = yaml.eval('a: 1\nb: 2 \n')
doc.should.eql { a: 1, b: 2 }
end
end
@@ -45,4 +45,11 @@ describe 'yaml'
yaml.eval('1 # foo').should.equal 1
end
end
+
+ describe 'hash with list'
+ it 'should work'
+ var expected = { pets: ['niko', 'simon'] }
+ yaml.eval(fixture('hash.list.yml')).should.eql expected
+ end
+ end
end

0 comments on commit 4d70502

Please sign in to comment.