@@ -335,7 +335,7 module Redmine | |||||
335 | # :pserver:anonymous@foo.bar:/path => /path |
|
335 | # :pserver:anonymous@foo.bar:/path => /path | |
336 | # :ext:cvsservername:/path => /path |
|
336 | # :ext:cvsservername:/path => /path | |
337 | def root_url_path |
|
337 | def root_url_path | |
338 |
root_url.to_s.gsub( |
|
338 | root_url.to_s.gsub(%r{^:.+?(?=/)}, '') | |
339 | end |
|
339 | end | |
340 |
|
340 | |||
341 | # convert a date/time into the CVS-format |
|
341 | # convert a date/time into the CVS-format |
@@ -79,6 +79,22 begin | |||||
79 | assert_equal "UTF-8", adpt2.path_encoding |
|
79 | assert_equal "UTF-8", adpt2.path_encoding | |
80 | end |
|
80 | end | |
81 |
|
81 | |||
|
82 | def test_root_url_path | |||
|
83 | to_test = { | |||
|
84 | ':pserver:cvs_user:cvs_password@123.456.789.123:9876/repo' => '/repo', | |||
|
85 | ':pserver:cvs_user:cvs_password@123.456.789.123/repo' => '/repo', | |||
|
86 | ':pserver:cvs_user:cvs_password@cvs_server:/repo' => '/repo', | |||
|
87 | ':pserver:cvs_user:cvs_password@cvs_server:9876/repo' => '/repo', | |||
|
88 | ':pserver:cvs_user:cvs_password@cvs_server/repo' => '/repo', | |||
|
89 | ':pserver:cvs_user:cvs_password@cvs_server/path/repo' => '/path/repo', | |||
|
90 | ':ext:cvsservername:/path' => '/path' | |||
|
91 | } | |||
|
92 | ||||
|
93 | to_test.each do |string, expected| | |||
|
94 | assert_equal expected, Redmine::Scm::Adapters::CvsAdapter.new('foo', string).send(:root_url_path), "#{string} failed" | |||
|
95 | end | |||
|
96 | end | |||
|
97 | ||||
82 | private |
|
98 | private | |
83 |
|
99 | |||
84 | def test_scm_version_for(scm_command_version, version) |
|
100 | def test_scm_version_for(scm_command_version, version) |
General Comments 0
You need to be logged in to leave comments.
Login now