Skip to content

Commit

Permalink
Upgrade test runner to node v0.1.30.
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Feb 25, 2010
1 parent 908480e commit 389c33c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/haml.js
@@ -1,7 +1,7 @@
var Haml = {};

// Bind to the exports object if it exists. (CommonJS and NodeJS)
if (exports) {
if (typeof exports !== 'undefined') {
Haml = exports;
}

Expand Down
11 changes: 5 additions & 6 deletions test/test.js
@@ -1,11 +1,10 @@
var file = require('file');
var posix = require('posix');
var fs = require('fs');
var assert = require('assert');
process.mixin(require('sys'));

var Haml = require("../lib/haml");

posix.readdir('.').addCallback(function (files) {
fs.readdir('.', function (err, files) {
files.forEach(function (haml_file) {
var m = haml_file.match(/^(.*)\.haml/),
base;
Expand All @@ -15,8 +14,8 @@ posix.readdir('.').addCallback(function (files) {
base = m[1];

function load_haml(scope) {
file.read(haml_file).addCallback(function (haml) {
file.read(base + ".html").addCallback(function (expected) {
fs.readFile(haml_file, function (err, haml) {
fs.readFile(base + ".html", function (err, expected) {
try {
var js = Haml.compile(haml);
var js_opt = Haml.optimize(js);
Expand All @@ -38,7 +37,7 @@ posix.readdir('.').addCallback(function (files) {

// Load scope
if (files.indexOf(base + ".js") >= 0) {
file.read(base + ".js").addCallback(function (js) {
fs.readFile(base + ".js", function (err, js) {
load_haml(eval("(" + js + ")"));
});
} else {
Expand Down

0 comments on commit 389c33c

Please sign in to comment.