History

Replace File.basename in URL#relative_path_to because it doesn't handle special characters in URLs well

nucular committed 10 years ago

Commit 034ecfa1 parent ceccfc02 files · +9 −1Browse files

Showing the changes to test (1 of 2 files). Show all

Unified · Split

test/lib/docs/core/url_test.rb+8−0
@@ -394,6 +394,14 @@ class DocsUrlTest < MiniTest::Spec · 393 unmodified lines
394 assert_equal 'file', url.relative_path_to('http://example.com/file?query#frag')394 assert_equal 'file', url.relative_path_to('http://example.com/file?query#frag')
395 end395 end
396 396
397 it "returns 'some:file' with 'http://example.com/some:file'" do
398 assert_equal 'some:file', url.relative_path_to('http://example.com/some:file')
399 end
400
401 it "returns 'some:file' with 'http://example.com/some:file?query#frag'" do
402 assert_equal 'some:file', url.relative_path_to('http://example.com/some:file?query#frag')
403 end
404
397 it "returns nil with '/file'" do405 it "returns nil with '/file'" do
398 assert_nil url.relative_path_to('/file')406 assert_nil url.relative_path_to('/file')
399 end407 end