Skip to content

Commit

Permalink
Added tests for webpath utils method
Browse files Browse the repository at this point in the history
  • Loading branch information
iexus committed Mar 6, 2014
1 parent 4a139c8 commit 970dcb6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/utils.js
Expand Up @@ -76,4 +76,20 @@ suite.add(new YUITest.TestCase({
}
}));

suite.add(new YUITest.TestCase({
name: 'produce valid web urls',
'test: Adds paths onto end in sequence' : function() {
var url = Y.webpath('foo', 'bar', 'baz');
Assert.areEqual('foo/bar/baz', url, 'parts should be added in sequence');
},
'test: normalises windows paths into web happy urls' : function() {
var url = Y.webpath('foo\\bar', 'baz');
Assert.areEqual('foo/bar/baz', url, '\\ should be normalised to /');
},
'test: joins relative paths' : function() {
var url = Y.webpath('./foo/bar', './baz/');
Assert.areEqual('foo/bar/baz/', url, 'should join relative paths');
}
}));

YUITest.TestRunner.add(suite);

0 comments on commit 970dcb6

Please sign in to comment.