File: relative-tests.js

package info (click to toggle)
node-amdefine 1.0.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 616 kB
  • sloc: javascript: 7,139; makefile: 2; sh: 1
file content (20 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
doh.register(
    "pluginsRelative",
    [
        function pluginsRelative(t){
            var branch = require('./sub/branch'),
                fs = require('fs'),
                path = require('path'),
                baseName = path.dirname(module.filename),
                twoText = fs.readFileSync(path.normalize(path.join(baseName, './sub/templates/two.txt')), 'utf8');

            t.is('branch', branch.name);
            t.is('leaf', branch.leaf.name);
            t.is(fs.readFileSync(path.normalize(path.join(baseName, './sub/templates/one.txt')), 'utf8'), branch.one);
            t.is(twoText, branch.two);
            t.is(twoText, branch.leaf.two);
        }
    ]
);

doh.run();