Skip to content

Commit 718319c

Browse files
fernandopasikSBoudrias
authored andcommitted
Add tests for .textEqual() (#18)
* Add tests for .textEqual() * Do coverage only for the generator file * Add empty lines between the tests
1 parent d805352 commit 718319c

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ gulp.task('nsp', function (cb) {
2121
});
2222

2323
gulp.task('pre-test', function () {
24-
return gulp.src('**/*.js')
24+
return gulp.src(['index.js'])
2525
.pipe(excludeGitignore())
2626
.pipe(istanbul({
2727
includeUntested: true

test.js

+23
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,29 @@ describe('yeoman-assert', function () {
120120
});
121121
});
122122

123+
describe('.textEqual()', function () {
124+
it('pass with two similar simple lines', function () {
125+
assert.doesNotThrow(yoAssert.textEqual.bind(yoAssert,
126+
'I have a yellow cat',
127+
'I have a yellow cat'
128+
));
129+
});
130+
131+
it('fails with two different simple lines', function () {
132+
assert.throws(yoAssert.textEqual.bind(yoAssert,
133+
'I have a yellow cat',
134+
'I have a brown cat'
135+
));
136+
});
137+
138+
it('pass with two similar simple lines with different new line types', function () {
139+
assert.doesNotThrow(yoAssert.textEqual.bind(yoAssert,
140+
'I have a\nyellow cat',
141+
'I have a\r\nyellow cat'
142+
));
143+
});
144+
});
145+
123146
describe('.implement()', function () {
124147
beforeEach(function () {
125148
this.subject = {foo: noop, bar: noop};

0 commit comments

Comments
 (0)