@@ -95,6 +95,9 @@ def test_guess_forge
95
95
svn = SvnAdapter . new ( :url => 'https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk' )
96
96
assert_equal 'sourceforge.net' , svn . guess_forge
97
97
98
+ svn = SvnAdapter . new ( :url => 'https://svn.code.sf.net/p/gallery/code/trunk/gallery2' )
99
+ assert_equal 'code.sf.net' , svn . guess_forge
100
+
98
101
svn = SvnAdapter . new ( :url => 'https://appfuse.dev.java.net/svn/appfuse/trunk' )
99
102
assert_equal 'java.net' , svn . guess_forge
100
103
@@ -106,14 +109,13 @@ def test_guess_forge
106
109
end
107
110
108
111
def test_sourceforge_requires_https
109
- assert_equal 'https ://gallery. svn.sourceforge. net/svnroot /gallery/trunk/gallery2',
110
- SvnAdapter . new ( :url => ' http://gallery.svn.sourceforge.net/svnroot/gallery/trunk/gallery2' ) . normalize . url
112
+ url = ' ://svn.code.sf. net/p /gallery/code/ trunk/gallery2'
113
+ assert_equal "https #{ url } " , SvnAdapter . new ( :url => " http#{ url } " ) . normalize . url
111
114
112
- assert_equal 'https://gallery.svn.sourceforge.net/svnroot/gallery/trunk/gallery2' ,
113
- SvnAdapter . new ( :url => 'https://gallery.svn.sourceforge.net/svnroot/gallery/trunk/gallery2' ) . normalize . url
115
+ assert_equal "https#{ url } " , SvnAdapter . new ( :url => "https#{ url } " ) . normalize . url
114
116
115
- assert_equal 'http ://pianosa.googlecode. com/svn/ trunk',
116
- SvnAdapter . new ( :url => 'http://pianosa.googlecode.com/svn/trunk' ) . normalize . url
117
+ url = 'https ://github. com/blackducksw/ohloh_scm/ trunk'
118
+ assert_equal url , SvnAdapter . new ( :url => url ) . normalize . url
117
119
end
118
120
119
121
def test_validate_server_connection
@@ -145,6 +147,16 @@ def test_recalc_branch_name
145
147
assert !svn_trunk_with_whack . branch_name
146
148
assert_equal '/trunk' , svn_trunk_with_whack . recalc_branch_name
147
149
assert_equal '/trunk' , svn_trunk_with_whack . branch_name
150
+
151
+ svn_trunk = SvnAdapter . new ( :url => svn . root + '/trunk' )
152
+ assert !svn_trunk . branch_name
153
+ svn_trunk . normalize # only normalize to ensure branch_name is populated correctly
154
+ assert_equal '/trunk' , svn_trunk . branch_name
155
+
156
+ svn_trunk = SvnAdapter . new ( :url => svn . root )
157
+ assert !svn_trunk . branch_name
158
+ svn_trunk . normalize
159
+ assert_equal '' , svn_trunk . branch_name
148
160
end
149
161
end
150
162
end
0 commit comments