1 | describe('booleanField', () => {
|
2 | var bool = require('../src/booleanField')
|
3 |
|
4 | describe('contains', () => {
|
5 | it('ok for booleans, otherwise false', () => {
|
6 | bool.contains(false).should.be.ok
|
7 | bool.contains(true).should.be.ok
|
8 | bool.contains(1).should.be.ko
|
9 | bool.contains('true').should.be.ko
|
10 | })
|
11 | })
|
12 |
|
13 | describe('equality', () => {
|
14 | it('works', () => {
|
15 | bool.equality(false, false).should.be.ok
|
16 | bool.equality(true, true).should.be.ok
|
17 | bool.equality(true, false).should.be.ko
|
18 | bool.equality(false, true).should.be.ko
|
19 | })
|
20 | })
|
21 |
|
22 | describe('negation', () => {
|
23 | it('works', () => {
|
24 | bool.negation(false).should.eql(true)
|
25 | bool.negation(true).should.eql(false)
|
26 | })
|
27 | })
|
28 |
|
29 | describe('addition', () => {
|
30 | it('has false as neutral element', () => {
|
31 | bool.addition(true, false).should.eql(true)
|
32 | bool.addition(false, false).should.eql(false)
|
33 | })
|
34 | })
|
35 |
|
36 | describe('multiplication', () => {
|
37 | it('has true as neutral element', () => {
|
38 | bool.multiplication(true, true).should.eql(true)
|
39 | bool.multiplication(false, true).should.eql(false)
|
40 | })
|
41 | })
|
42 | })
|