Skip to content

Commit

Permalink
tests reordered
Browse files Browse the repository at this point in the history
  • Loading branch information
nadav-dav committed Dec 1, 2014
1 parent 5c15ddc commit cb8c4cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/rekuire.spec.js
Expand Up @@ -236,9 +236,8 @@ describe("Testing 'rekuire'",function(){

describe("when two packages are using Rekuire, one is nested inside the other", function(){
it("should each rekuire modules from the package scope", function(){
createNamePackage();
createPackageWithNestedPackage();
fs.copySync(file('/test/testResources/nested-modules-example/name'), path.resolve(base + '/node_modules/name'));
copyRekToNodeModules(file('/node_modules/parent-package/node_modules'));
var rek = require('rekuire');
var pkgWithChild = rek('parent-package');
expect(rekuireName()).toEqual("root");
Expand All @@ -247,18 +246,20 @@ describe("Testing 'rekuire'",function(){
cleanUp();


function createNamePackage(){
fs.copySync(file('/test/testResources/nested-modules-example/name'), path.resolve(base + '/node_modules/name'));
}
function rekuireName(){
return rek('name');
}

function cleanUp(){
fs.removeSync(path.resolve(path.resolve(base + '/node_modules/name')));
fs.removeSync(path.resolve(path.resolve(base + '/node_modules/parent-package')));
}

function createPackageWithNestedPackage(){
fs.copySync(file('/test/testResources/nested-modules-example/parent-package'), file('/node_modules/parent-package'));
copyRekToNodeModules(file('/node_modules/parent-package/node_modules/child-package/node_modules'));
copyRekToNodeModules(file('/node_modules/parent-package/node_modules'));
}
})
})
Expand Down

0 comments on commit cb8c4cd

Please sign in to comment.