Skip to content

Commit

Permalink
Add test for filenames with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
fixedset committed Apr 15, 2012
1 parent f2af100 commit 71c975e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/open.js
Expand Up @@ -31,5 +31,5 @@ function open(target, callback) {
// TODO: what are the implications of quoting target?
// - we'll need to look at target to see if its already quoted
// - different platforms may treat quotes differently
return exec(opener + ' ' + target + '', callback);
return exec(opener + ' "' + target + '"', callback);
}
4 changes: 4 additions & 0 deletions test/open.js
Expand Up @@ -21,6 +21,10 @@ describe('open', function() {
it('should open txt file in default text editor', function(done) {
open(pathTo('asset.txt'), done);
});

it('should open files with spaces', function(done) {
open(pathTo('with space.html'), done);
});

});

4 changes: 4 additions & 0 deletions test/support/with space.html
@@ -0,0 +1,4 @@
<html>
<h1>open.js test asset</h1>
<p>If this is your default browser, it worked. You can close this.</p>
</html>

0 comments on commit 71c975e

Please sign in to comment.