Completed
Push — master ( e193d1...415e1b )
by Justin
01:32
created

AtomCommon.js ➔ describe(ꞌAtomCommonꞌ)   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 28
rs 8.8571

3 Functions

Rating   Name   Duplication   Size   Complexity  
A AtomCommon.js ➔ ... ➔ it(ꞌbuildꞌ) 0 7 1
A AtomCommon.js ➔ ... ➔ it(ꞌinit from JSONꞌ) 0 8 1
A AtomCommon.js ➔ ... ➔ it(ꞌtoJSONꞌ) 0 7 1
1
var assert = require('chai').assert,
2
    AtomCommon = require('../../src/atom/AtomCommon');
3
4
describe('AtomCommon', function(){
5
  
6
  it('init from JSON', function(){
7
    var common = AtomCommon({
8
      base: 'base',
9
      lang: 'lang'
10
    });
11
    assert.equal(common.getBase(), 'base');
12
    assert.equal(common.getLang(), 'lang');
13
  });
14
  
15
  it('build', function(){
16
    var common = AtomCommon()
17
      .setBase('base')
18
      .setLang('lang');
19
    assert.equal(common.getBase(), 'base');
20
    assert.equal(common.getLang(), 'lang');
21
  });
22
  
23
  it('toJSON', function(){
24
    var data = {
25
      base: 'base',
26
      lang: 'lang'
27
    };
28
    assert.deepEqual(AtomCommon(data).toJSON(), data);
29
  });
30
  
31
});