diff options
Diffstat (limited to 'test/page.js')
-rw-r--r-- | test/page.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/page.js b/test/page.js index 9007c45..d844d13 100644 --- a/test/page.js +++ b/test/page.js @@ -38,6 +38,18 @@ describe('Page', function() { }); }); + describe('.relative', function() { + it('should correctly resolve absolute path in the book', function() { + var page = book.addPage('heading.md'); + var page2 = book.addPage('folder/paths.md'); + + page.relative('/test.png').should.equal('test.png'); + page.relative('test.png').should.equal('test.png'); + page2.relative('/test.png').should.equal('../test.png'); + page2.relative('test.png').should.equal('test.png'); + }); + }); + describe('Headings', function() { it('should add a default ID to headings', function() { var page = book.addPage('heading.md'); |