relative-tests.js 698 B

1234567891011121314151617181920
  1. doh.register(
  2. "pluginsRelative",
  3. [
  4. function pluginsRelative(t){
  5. var branch = require('./sub/branch'),
  6. fs = require('fs'),
  7. path = require('path'),
  8. baseName = path.dirname(module.filename),
  9. twoText = fs.readFileSync(path.normalize(path.join(baseName, './sub/templates/two.txt')), 'utf8');
  10. t.is('branch', branch.name);
  11. t.is('leaf', branch.leaf.name);
  12. t.is(fs.readFileSync(path.normalize(path.join(baseName, './sub/templates/one.txt')), 'utf8'), branch.one);
  13. t.is(twoText, branch.two);
  14. t.is(twoText, branch.leaf.two);
  15. }
  16. ]
  17. );
  18. doh.run();