1 | var assert = require('assert')
|
2 | , chai = require('chai')
|
3 | , dg = require( '../lib/dg.js' );
|
4 |
|
5 | var input = [ 'test', 'another test', 1234, 'a string' ];
|
6 |
|
7 | it('in', function () {
|
8 | var r = dg.in( input, 'a string' );
|
9 | assert( r, 'returned truth' );
|
10 | var s = dg.in( input, 'peace on earth' );
|
11 | chai.assert.notOk( s, 'returned false (boo-hoo)' );
|
12 | } );
|
13 |
|
14 | it('all_in', function () {
|
15 | var r = dg.all_in( input, [ 'a string', 'test' ] );
|
16 | assert(r, 'truth returned');
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | r.forEach( function (test) {
|
23 | chai.assert.include( [ 'a string', 'test' ], test, 'correct values returned' );
|
24 | } );
|
25 | } );
|