b74e06a99e2120d8b6dac05b96d801efdee1528e
[platform/framework/web/crosswalk-tizen.git] /
1 var assert = require('assert');
2 var eolFormatter = require('../');
3
4 describe('EOL-last formatter', function() {
5         it('adds newline at end of input', function() {
6                 //Given.
7                 var input = 'Hi!';
8                 var expectedOutput = 'Hi!\n';
9
10                 //When
11                 var formatterOutput = eolFormatter.stringAfter(input);
12
13                 //Then
14                 assert(formatterOutput, expectedOutput);
15         });
16
17         it('does not add newline at end of input with a newline', function() {
18                 //Given.
19                 var input = 'Hi!\n';
20
21                 //When
22                 var formatterOutput = eolFormatter.stringAfter(input);
23
24                 //Then
25                 assert(formatterOutput, input);
26         });
27 })