Permalink
Browse files

Specs for inline pairs / sequences

  • Loading branch information...
1 parent 7f769e6 commit 8745b2b7bc1e2f90bb40c2fa6eefe7227ec11661 @tj committed Oct 1, 2009
Showing with 17 additions and 3 deletions.
  1. +6 −0 Readme.md
  2. +11 −3 spec/spec.core.js
View
@@ -6,6 +6,12 @@ JavaScript YAML parser, fast and tiny.
# Examples
YAML.eval(string_of_yaml)
+
+# Testing
+
+Grab [JSpec](http://jspec.info) and execute the following command:
+
+ $ jspec run --rhino
# License
View
@@ -2,9 +2,9 @@
describe 'YAML'
describe '.strip()'
it 'should strip leading / trailing whitespace'
- YAML.strip('foo ').should.be 'foo'
- YAML.strip(' foo').should.be 'foo'
- YAML.strip(' foo ').should.be 'foo'
+ YAML.strip('foo ').should.eql 'foo'
+ YAML.strip(' foo').should.eql 'foo'
+ YAML.strip(' foo ').should.eql 'foo'
end
end
@@ -102,6 +102,10 @@ describe 'YAML'
}
YAML.eval(yml).should.eql expected
end
+
+ it 'should parse inline sequences'
+ YAML.eval('foo: [1, 2, 3]').should.eql { foo: [1,2,3] }
+ end
end
describe 'pairs'
@@ -116,6 +120,10 @@ describe 'YAML'
'
YAML.eval(yml).should.eql { boot: false, enabled: true }
end
+
+ it 'should parse inline pairs'
+ YAML.eval('foo: { n: 1 }').should.eql { foo: { n: 1 }}
+ end
end
describe 'integration'

0 comments on commit 8745b2b

Please sign in to comment.