2012-06-23 04:59:04 +04:00
|
|
|
describe("Module", function() {
|
2012-06-24 02:42:47 +04:00
|
|
|
it("has filename property containing its absolute path", function() {
|
|
|
|
module.filename.should.match(/\/.*test\/module_spec.js/);
|
|
|
|
});
|
2012-06-23 04:59:04 +04:00
|
|
|
|
2012-06-24 02:42:47 +04:00
|
|
|
it("has id property equal to filename", function() {
|
|
|
|
module.id.should.equal(module.filename);
|
|
|
|
});
|
2012-06-23 04:59:04 +04:00
|
|
|
|
2012-06-24 02:42:47 +04:00
|
|
|
it("has dirname property containing absolute path to its directory", function() {
|
|
|
|
module.dirname.should.match(/\/.*test/);
|
|
|
|
});
|
2012-06-23 04:59:04 +04:00
|
|
|
|
2012-06-24 02:42:47 +04:00
|
|
|
it("its require() can be used externally", function() {
|
|
|
|
var exposed = require('dummy_exposed');
|
|
|
|
exposed.require('./dummy_file').should.equal('spec/node_modules/dummy_file');
|
|
|
|
});
|
2012-06-23 04:59:04 +04:00
|
|
|
});
|