Skip to content

Commit

Permalink
update fixture paths for sandbox tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Caolan McMahon committed Sep 24, 2010
1 parent 755e6b7 commit 4f8a013
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/test-sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@ var sandbox = require('../lib/utils').sandbox;
var testCase = nodeunit.testCase;

exports.testSimpleSandbox = function(test){
var raw_jscode1 = sandbox('fixtures/raw_jscode1.js');
var raw_jscode1 = sandbox(__dirname + '/fixtures/raw_jscode1.js');
test.equal(raw_jscode1.hello_world('foo'), '_foo_', 'evaluation ok');
test.done();
};

exports.testSandboxContext = function(test){
a_variable = 42; // should not be visible in the sandbox
var raw_jscode2 = sandbox('fixtures/raw_jscode2.js');
var raw_jscode2 = sandbox(__dirname + '/fixtures/raw_jscode2.js');
a_variable = 42; // again for the win
test.equal(raw_jscode2.get_a_variable(), 'undefined', 'the variable should not be defined');
test.equal(
raw_jscode2.get_a_variable(),
'undefined',
'the variable should not be defined'
);
test.done();
};

exports.testSandboxMultiple = function(test){
var raw_jscode3 = sandbox(['fixtures/raw_jscode3.js','fixtures/raw_jscode3.js','fixtures/raw_jscode3.js']);
var raw_jscode3 = sandbox([
__dirname + '/fixtures/raw_jscode3.js',
__dirname + '/fixtures/raw_jscode3.js',
__dirname + '/fixtures/raw_jscode3.js'
]);
test.equal(raw_jscode3.t, 3, 'two files loaded');
test.done();
};

0 comments on commit 4f8a013

Please sign in to comment.