Skip to content

Commit

Permalink
test(licensify): make operators test a bit more expressive
Browse files Browse the repository at this point in the history
  • Loading branch information
twada committed Mar 14, 2016
1 parent c1a58e8 commit b17f275
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,16 @@ describe('type-less licenses', function () {
});
});


describe('multiple common licenses', function () {
var expectedModules = [
'test-conjunctive-and-operator',
'test-disjunctive-or-operator'
];
var expectedOperators = [
'OR', 'AND'
]
var expectedLicences = [
'LGPL-2.1 \\(http://opensource.org/licenses/LGPL-2.1\\) AND MIT \\(http://opensource.org/licenses/MIT\\)',
'LGPL-2.1 \\(http://opensource.org/licenses/LGPL-2.1\\) OR MIT \\(http://opensource.org/licenses/MIT\\)'
];

describe('should also be in output', function () {
var header;
Expand All @@ -370,9 +372,9 @@ describe('multiple common licenses', function () {
assert(re.test(header));
});
});
expectedOperators.forEach(function (operators) {
var re = new RegExp(operators, 'gm');
it('ensure header includes [' + operators + ']', function () {
expectedLicences.forEach(function (licenses) {
var re = new RegExp(licenses, 'gm');
it('ensure header includes [' + licenses + ']', function () {
assert(re.test(header));
});
});
Expand Down

0 comments on commit b17f275

Please sign in to comment.