Merged r12017 and r12027 from trunk (#14422).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12065 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e8757fec2b
commit
e1e006f09e
|
@ -335,7 +335,7 @@ module Redmine
|
|||
# :pserver:anonymous@foo.bar:/path => /path
|
||||
# :ext:cvsservername:/path => /path
|
||||
def root_url_path
|
||||
root_url.to_s.gsub(/^:.+:\d*/, '')
|
||||
root_url.to_s.gsub(%r{^:.+?(?=/)}, '')
|
||||
end
|
||||
|
||||
# convert a date/time into the CVS-format
|
||||
|
|
|
@ -79,6 +79,22 @@ begin
|
|||
assert_equal "UTF-8", adpt2.path_encoding
|
||||
end
|
||||
|
||||
def test_root_url_path
|
||||
to_test = {
|
||||
':pserver:cvs_user:cvs_password@123.456.789.123:9876/repo' => '/repo',
|
||||
':pserver:cvs_user:cvs_password@123.456.789.123/repo' => '/repo',
|
||||
':pserver:cvs_user:cvs_password@cvs_server:/repo' => '/repo',
|
||||
':pserver:cvs_user:cvs_password@cvs_server:9876/repo' => '/repo',
|
||||
':pserver:cvs_user:cvs_password@cvs_server/repo' => '/repo',
|
||||
':pserver:cvs_user:cvs_password@cvs_server/path/repo' => '/path/repo',
|
||||
':ext:cvsservername:/path' => '/path'
|
||||
}
|
||||
|
||||
to_test.each do |string, expected|
|
||||
assert_equal expected, Redmine::Scm::Adapters::CvsAdapter.new('foo', string).send(:root_url_path), "#{string} failed"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def test_scm_version_for(scm_command_version, version)
|
||||
|
|
Loading…
Reference in New Issue