11var should = require ( 'chai' ) . should ( ) ;
22var expect = require ( 'chai' ) . expect ;
3+ var rewire = require ( 'rewire' ) ;
34describe ( 'worker/stat.js' , function ( ) {
45 it ( 'should have a idrinth variable in scope' , function ( ) {
5- var idrinth = require ( ' rewire' ) ( "../../src/workers/stats" ) . __get__ ( 'idrinth' ) ;
6+ var idrinth = rewire ( "../../src/workers/stats" ) . __get__ ( 'idrinth' ) ;
67 should . exist ( idrinth ) ;
78 idrinth . should . be . an ( 'object' ) ;
89 describe ( 'idrinth' , function ( ) {
@@ -34,6 +35,13 @@ describe ( 'worker/stat.js', function ( ) {
3435 describe ( 'idrinth.MultiplierSet' , function ( ) {
3536 it ( 'MultiplierSet should be a function' , function ( ) {
3637 idrinth . MultiplierSet . should . be . a ( 'function' ) ;
38+ describe ( 'idrinth.MultiplierSet#Instance' , function ( ) {
39+ var multiplier = new idrinth . MultiplierSet ( ) ;
40+ it ( 'MultiplierSet should return an object' , function ( ) {
41+ should . exist ( multiplier ) ;
42+ multiplier . should . be . an ( 'object' ) ;
43+ } ) ;
44+ } ) ;
3745 } ) ;
3846 } ) ;
3947 } ) ;
@@ -42,14 +50,28 @@ describe ( 'worker/stat.js', function ( ) {
4250 describe ( 'idrinth.StatSet' , function ( ) {
4351 it ( 'StatSet should be a function' , function ( ) {
4452 idrinth . StatSet . should . be . a ( 'function' ) ;
53+ describe ( 'idrinth.StatSet#Instance' , function ( ) {
54+ var stat = new idrinth . StatSet ( ) ;
55+ it ( 'StatSet should return an object' , function ( ) {
56+ should . exist ( stat ) ;
57+ stat . should . be . an ( 'object' ) ;
58+ } ) ;
59+ } ) ;
4560 } ) ;
4661 } ) ;
4762 } ) ;
4863 it ( 'should have a Calculator property' , function ( ) {
4964 expect ( idrinth ) . to . have . property ( 'Calculator' ) ;
5065 describe ( 'idrinth.Calculator' , function ( ) {
5166 it ( 'Calculator should be a function' , function ( ) {
52- idrinth . Calculator . should . be . a ( 'function' ) ;
67+ idrinth . Calculator . should . be . a ( 'function' ) ;
68+ describe ( 'idrinth.Calculator#Instance' , function ( ) {
69+ var calculator = new idrinth . Calculator ( ) ;
70+ it ( 'Calculator should return an object' , function ( ) {
71+ should . exist ( calculator ) ;
72+ calculator . should . be . an ( 'object' ) ;
73+ } ) ;
74+ } ) ;
5375 } ) ;
5476 } ) ;
5577 } ) ;
0 commit comments