Skip to content

Commit 2b410b4

Browse files
committed
tests: Trim whitespace before comparing
1 parent 8aff074 commit 2b410b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/examples.coffee

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ testExample = (testcase) ->
88
diff = ''
99
it 'should produce a diff', ->
1010
diff = fbpDiff.diff testcase.from, testcase.to, options
11+
diff = diff.trim()
1112
chai.expect(diff).to.be.a 'string'
1213
it 'diff should equal expected', ->
13-
chai.expect(diff).to.equal testcase.diff
14+
expected = testcase.diff.trim()
15+
chai.expect(diff).to.equal expected
1416

1517
loadTestCases = () ->
1618
# currently node.js only
@@ -35,7 +37,7 @@ tests = loadTestCases()
3537

3638
describe 'Examples', ->
3739
it 'should exist', ->
38-
chai.expect(tests).to.have.length.above 1
40+
chai.expect(tests).to.have.length.above 13
3941

4042
for testcase in tests
4143
describeUnlessSkipped = if testcase.skip then describe.skip else describe

0 commit comments

Comments
 (0)