Permalink
Browse files

Land: Fix: allow jsdom.env's config.html to handle file paths which c…

…ontain spaces (shinuza)
  • Loading branch information...
tmpvar committed Apr 12, 2012
2 parents 0f25574 + b75f4da commit 8205d8eb99526682b3b2a3c3c4940c2f59a014f9
Showing with 19 additions and 1 deletion.
  1. +1 −1 lib/jsdom.js
  2. +8 −0 test/jsdom/files/folder space/space.html
  3. +10 −0 test/jsdom/index.js
View
@@ -275,7 +275,7 @@ exports.env = exports.jsdom.env = function() {
processHTML(err, body);
});
} else {
- fs.readFile(url.pathname, processHTML);
+ fs.readFile(config.html, processHTML);
}
}
};
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>hello, Node.js!</title>
+ </head>
+ <body>
+ </body>
+</html>
View
@@ -69,6 +69,16 @@ exports.tests = {
});
},
+ env_with_absolute_file_with_spaces: function(test) {
+ jsdom.env({
+ html: path.join(__dirname, 'files/folder space', 'space.html'),
+ done: function(errors, window) {
+ test.equal(errors, null, 'errors should be null');
+ test.done()
+ }
+ });
+ },
+
env_with_html: function(test) {
var html = "<html><body><p>hello world!</p></body></html>";
jsdom.env({

0 comments on commit 8205d8e

Please sign in to comment.