Skip to content

Instantly share code, notes, and snippets.

@mcantelon
Created March 11, 2011 16:47
Show Gist options
  • Save mcantelon/866171 to your computer and use it in GitHub Desktop.
Save mcantelon/866171 to your computer and use it in GitHub Desktop.
Test logic for YAML literal
var yaml = require('yaml')
, fs = require('fs')
, should = require('should')
var ideal = {
jim: 'Hey there.',
bob: 'I am the law!\nYou will kneel!',
rick: 'Sure'
}
var result = yaml.eval(fs.readFileSync('test.yml').toString())
result.jim.should.equal('Hey there.')
result.bob.should.equal("I am the law!\nYou will kneel!")
result.rick.should.equal('Sure')
console.log('Test passed.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment