'use strict';

var expect = require('expect.js');
var configBuilder = require('../lib');

describe('ConfigBuilder', function() {
	it('test exported singleton', function() {
		configBuilder.register({
			name: 'test',
			config: {
				a: 1,
				b: '12',
				c: null,
				d: function(config) {
					return 100500;
				}
			}
		});

		var config = configBuilder.get('test');

		expect(config).to.eql({
			a: 1,
			b: '12',
			c: null,
			d: 100500
		});
	});
});

@@ -131,13 +131,8 @@
 it('
-test 
 expo
@@ -145,16 +145,29 @@
 ingleton
+ simle config
 ', funct
@@ -446,16 +446,16 @@
  100500%0A
-
 %09%09%7D);%0A%09%7D
@@ -456,13 +456,808 @@
 %7D);%0A%09%7D);
+%0A%0A%09it('config inheritance', function() %7B%0A%09%09configBuilder.register(%7B%0A%09%09%09name: 'parent',%0A%09%09%09config: %7B%0A%09%09%09%09a: 1,%0A%09%09%09%09b: '12',%0A%09%09%09%09c: null,%0A%09%09%09%09d: function(config) %7B%0A%09%09%09%09%09return 100500;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%09configBuilder.register(%7B%0A%09%09%09parent: 'parent',%0A%09%09%09name: 'children',%0A%09%09%09config: %7B%0A%09%09%09%09a: 2,%0A%09%09%09%09e: '22'%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%09var config = configBuilder.get('children');%0A%0A%09%09expect(config).to.eql(%7B%0A%09%09%09a: 2,%0A%09%09%09b: '12',%0A%09%09%09c: null,%0A%09%09%09d: 100500,%0A%09%09%09e: '22'%0A%09%09%7D);%0A%09%7D);%0A%0A%09it('function field', function() %7B%0A%09%09configBuilder.register(%7B%0A%09%09%09name: 'funcConfig',%0A%09%09%09config: %7B%0A%09%09%09%09f: configBuilder.func(function(a, b, c) %7B%0A%09%09%09%09%09return a + b + c;%0A%09%09%09%09%7D)%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%09var config = configBuilder.get('funcConfig');%0A%0A%09%09expect(config.f).to.be.a('function');%0A%0A%09%09var res = config.f(1, 2, 3);%0A%0A%09%09expect(res).to.be(6);%0A%09%7D);
 %0A%7D);%0A

test added