File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3
3
module OhlohScm
4
4
module Git
5
5
class Validation < OhlohScm ::Validation
6
+ def validate
7
+ super
8
+ @errors << [ :branch_name , 'Invalid Branch Name.' ] if scm . branch_name . to_s . empty?
9
+ end
10
+
6
11
private
7
12
8
13
def validate_server_connection
9
- msg = "The server did not respond to the 'git-ls-remote' command. Is the URL correct?"
14
+ msg = "The server did not respond to the 'git-ls-remote' command."
15
+ msg << ' Are the URL and Branch fields correct?'
10
16
@errors << [ :failed , msg ] unless status . exist?
11
17
end
12
18
Original file line number Diff line number Diff line change 2
2
3
3
module OhlohScm
4
4
module Version
5
- STRING = '3.0.9 '
5
+ STRING = '3.0.10 '
6
6
GIT = '2.17.1'
7
7
SVN = '1.9.7'
8
8
CVSNT = '2.5.04'
Original file line number Diff line number Diff line change 7
7
core . errors . must_be :empty?
8
8
end
9
9
10
+ it 'must have errors for no branch_name' do
11
+ get_core ( :git , branch_name : '' ) . validation . send ( :branch_name_errors ) . wont_be :empty?
12
+ end
13
+
10
14
it 'must have errors for invalid branch_name' do
11
15
get_core ( :git , branch_name : 'x' * 81 ) . validation . send ( :branch_name_errors ) . wont_be :empty?
12
16
get_core ( :git , branch_name : 'foo@bar' ) . validation . send ( :branch_name_errors ) . wont_be :empty?
You can’t perform that action at this time.
0 commit comments