Skip to content

Commit

Permalink
fix yaml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Oct 11, 2017
1 parent b95bba4 commit 0d096d1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2689,9 +2689,10 @@ describe('writers', function () {
it('should write as yaml with indent', function (done) {
var filePath = ['test', 'tmp-write-data-yaml-indent', 'data.yaml']
io.writeData(filePath.join(path.sep), testData, {makeDirectories: true, indent: 4}, function (err, dataString) {
var testString = '-\n name: jim\n occupation: land surveyor\n height: 70\n-\n name: francis\n occupation: conductor\n height: 63\n'
assert.equal(err, null)
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
assert.equal(dataString, '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), testString)
assert.equal(dataString, testString)
rimraf(filePath.slice(0, 2).join(path.sep), {glob: false}, function (err) {
assert.equal(err, null)
done()
Expand All @@ -2716,9 +2717,10 @@ describe('writers', function () {
it('should write as yml with indent', function (done) {
var filePath = ['test', 'tmp-write-data-yml-indent', 'data.yml']
io.writeData(filePath.join(path.sep), testData, {makeDirectories: true, indent: 4}, function (err, dataString) {
var testString = '-\n name: jim\n occupation: land surveyor\n height: 70\n-\n name: francis\n occupation: conductor\n height: 63\n'
assert.equal(err, null)
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
assert.equal(dataString, '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), testString)
assert.equal(dataString, testString)
rimraf(filePath.slice(0, 2).join(path.sep), {glob: false}, function (err) {
assert.equal(err, null)
done()
Expand Down Expand Up @@ -2908,8 +2910,9 @@ describe('writers', function () {
makeDirectories: true,
indent: 4
})
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
assert.equal(dataString, '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
var testString = '-\n name: jim\n occupation: land surveyor\n height: 70\n-\n name: francis\n occupation: conductor\n height: 63\n'
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), testString)
assert.equal(dataString, testString)
rimraf(filePath.slice(0, 2).join(path.sep), {glob: false}, function (err) {
assert.equal(err, null)
done()
Expand All @@ -2934,8 +2937,9 @@ describe('writers', function () {
makeDirectories: true,
indent: 4
})
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
assert.equal(dataString, '- \n name: jim\n occupation: land surveyor\n height: 70\n- \n name: francis\n occupation: conductor\n height: 63\n')
var testString = '-\n name: jim\n occupation: land surveyor\n height: 70\n-\n name: francis\n occupation: conductor\n height: 63\n'
assert.equal(fs.readFileSync(filePath.join(path.sep), 'utf-8'), testString)
assert.equal(dataString, testString)
rimraf(filePath.slice(0, 2).join(path.sep), {glob: false}, function (err) {
assert.equal(err, null)
done()
Expand Down

0 comments on commit 0d096d1

Please sign in to comment.