var chai = require('chai');
var expect = chai.expect;

var lupa = require('../lupa');

describe("Lupa", function () {
    it("should return correct data structure", function (done) {
        var plugins = ['../plugins/SizePlugin', '../plugins/LOCPlugin.js'].map(require).map(function (Constr) {
            return Constr();
        });
        plugins.push(require('../plugins/RegExpPlugin')(/function +abc.*\(.*?\)/g, 'abc'));
        lupa.run("mocks/**/*.js", plugins, function (err, data) {
            console.log("Output data: ", JSON.stringify(data, null, 2));

            var name1 = 'mocks/funcMock.js';
            var name2 = 'mocks/1/objMock.js';
            expect(data).to.have.property(name1);
            expect(data).to.have.property(name2);
            expect(data[name1].file).to.equal(name1);
            expect(data[name1].size).to.equal(101);
            expect(data[name1].loc).to.equal(21);
            expect(data[name1].abc).to.exist();
            expect(data[name1].abc.length).to.equal(2);

            expect(data[name2].size).to.equal(44);
            expect(data[name2].loc).to.equal(5);
            expect(data[name2].file).to.equal(name2);
            expect(data[name2].abc).to.equal(null);
            done();
        });

        expect(false).to.equal(false);
    });
});

@@ -115,77 +115,8 @@
 ) %7B%0A
-    it(%22should return correct data structure%22, function (done) %7B%0A    
     
@@ -227,20 +227,16 @@
         
-    
 return C
@@ -252,20 +252,12 @@
     
- 
-   
 %7D);%0A
-    
     
@@ -344,40 +344,202 @@
 ));%0A
+%0A
     
-    lupa.run(%22mocks/**/*.js%22
+describe(%22dataset 1%22, function () %7B%0A        var filePattern = %22mocks/**/*.js%22;%0A        %0A        it(%22should return correct data structure%22, function (done) %7B%0A            lupa.run(filePattern
 , pl
@@ -564,24 +564,28 @@
 rr, data) %7B%0A
+    
             
@@ -650,32 +650,36 @@
 );%0A%0A            
+    
 var name1 = 'moc
@@ -699,32 +699,36 @@
 s';%0A            
+  
+  
 var name2 = 'moc
@@ -737,32 +737,36 @@
 /1/objMock.js';%0A
+    
             expe
@@ -791,32 +791,36 @@
 roperty(name1);%0A
+    
             expe
@@ -857,32 +857,36 @@
 2);%0A            
+    
 expect(data%5Bname
@@ -915,32 +915,36 @@
 1);%0A            
+    
 expect(data%5Bname
@@ -971,32 +971,36 @@
 1);%0A            
+   
+ 
 expect(data%5Bname
@@ -1017,24 +1017,28 @@
 .equal(21);%0A
+    
             
@@ -1077,32 +1077,36 @@
 ();%0A            
+    
 expect(data%5Bname
@@ -1138,32 +1138,36 @@
 );%0A%0A            
+ 
+   
 expect(data%5Bname
@@ -1193,32 +1193,36 @@
 4);%0A            
+    
 expect(data%5Bname
@@ -1242,16 +1242,20 @@
 ual(5);%0A
+    
         
@@ -1304,32 +1304,36 @@
 2);%0A            
+    
 expect(data%5Bname
@@ -1368,16 +1368,20 @@
         
+    
 done();%0A
@@ -1392,13 +1392,21 @@
     
+  
+  
 %7D);%0A%0A
+    
     
@@ -1444,16 +1444,30 @@
 e);%0A    
-%7D);
+    %7D);%0A%0A    %7D);%0A
 %0A%7D);%0A

refactor lupaSpec.js to easy add new different datasets