Added two regression tests for URL#relative_path_to

pull/407/head
nucular 9 years ago
parent 3542f5bf29
commit d0b45d554b

@ -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

Loading…
Cancel
Save