From d0b45d554b5a954d4f07fd6fa5667a4cc4613edd Mon Sep 17 00:00:00 2001 From: nucular Date: Mon, 16 May 2016 16:24:32 +0200 Subject: [PATCH] Added two regression tests for URL#relative_path_to --- test/lib/docs/core/url_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/lib/docs/core/url_test.rb b/test/lib/docs/core/url_test.rb index 71464b9e..8dd187c5 100644 --- a/test/lib/docs/core/url_test.rb +++ b/test/lib/docs/core/url_test.rb @@ -394,6 +394,14 @@ class DocsUrlTest < MiniTest::Spec assert_equal 'file', url.relative_path_to('http://example.com/file?query#frag') end + it "returns 'some:file' with 'http://example.com/some:file'" do + assert_equal 'some:file', url.relative_path_to('http://example.com/some:file') + end + + it "returns 'some:file' with 'http://example.com/some:file?query#frag'" do + assert_equal 'some:file', url.relative_path_to('http://example.com/some:file?query#frag') + end + it "returns nil with '/file'" do assert_nil url.relative_path_to('/file') end