diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-08-21 17:31:59 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-08-21 17:31:59 -0600 |
| commit | 0cbab4713b4a8588068621d2f216d57ea3890530 (patch) | |
| tree | 992c65a49d1b4c540917d57a3d47b1417c605814 /test/paths_test.rb | |
| parent | a4c744810eb5259b4564f896066c9eec9c3f0281 (diff) | |
introduce method to calc path relative to base_dir
Diffstat (limited to 'test/paths_test.rb')
| -rw-r--r-- | test/paths_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/paths_test.rb b/test/paths_test.rb index 0a4a3e96..35e84ec1 100644 --- a/test/paths_test.rb +++ b/test/paths_test.rb @@ -174,5 +174,11 @@ context 'Path Resolver' do assert_equal 'C:/data/docs', @resolver.system_path('..\\..', "C:\\data\\docs\\assets", 'C:\\data\\docs') assert_equal 'C:/data/docs/css', @resolver.system_path('..\\..\\css', "C:\\data\\docs\\assets", 'C:\\data\\docs') end + + test 'should calculate relative path' do + filename = @resolver.system_path('part1/chapter1/section1.adoc', nil, JAIL) + assert_equal "#{JAIL}/part1/chapter1/section1.adoc", filename + assert_equal 'part1/chapter1/section1.adoc', @resolver.relative_path(filename, JAIL) + end end end |
