File tree Expand file tree Collapse file tree 6 files changed +12
-16
lines changed Expand file tree Collapse file tree 6 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,10 @@ def initialize(core)
12
12
end
13
13
14
14
def exist?
15
- return unless scm_dir_exist?
16
-
17
15
!activity . head_token . to_s . empty?
16
+ rescue RuntimeError
17
+ logger . debug { $ERROR_INFO. inspect }
18
+ false
18
19
end
19
20
20
21
def scm_dir_exist?
Original file line number Diff line number Diff line change @@ -20,9 +20,7 @@ def validate
20
20
21
21
private
22
22
23
- def validate_server_connection
24
- return unless valid?
25
- end
23
+ def validate_server_connection ; end
26
24
27
25
# rubocop:disable Metrics/AbcSize
28
26
def validate_attributes
Original file line number Diff line number Diff line change 2
2
3
3
module OhlohScm
4
4
module Version
5
- STRING = '3.0.1 '
5
+ STRING = '3.0.2 '
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
with_bzr_repository ( 'bzr' ) do |src |
8
8
tmpdir do |dest_dir |
9
9
core = OhlohScm ::Factory . get_core ( scm_type : :bzr , url : dest_dir )
10
- refute core . status . exist ?
10
+ refute core . status . scm_dir_exist ?
11
11
12
12
core . scm . pull ( src . scm , TestCallback . new )
13
+ assert core . status . scm_dir_exist?
13
14
assert core . status . exist?
14
15
end
15
16
end
Original file line number Diff line number Diff line change 5
5
with_git_repository ( 'git' ) do |src_core |
6
6
tmpdir do |dest_dir |
7
7
core = OhlohScm ::Factory . get_core ( scm_type : :git , url : dest_dir )
8
- refute core . status . exist ?
8
+ refute core . status . scm_dir_exist ?
9
9
10
10
core . scm . pull ( src_core . scm , TestCallback . new )
11
+ assert core . status . scm_dir_exist?
11
12
assert core . status . exist?
12
13
end
13
14
end
19
20
with_git_repository ( 'git_with_multiple_branch' , 'test' ) do |src_core |
20
21
tmpdir do |dest_dir |
21
22
core = OhlohScm ::Factory . get_core ( scm_type : :git , url : dest_dir , branch_name : 'test' )
22
- refute core . status . exist ?
23
+ refute core . status . scm_dir_exist ?
23
24
core . scm . pull ( src_core . scm , TestCallback . new )
24
25
25
26
remote_master_branch_sha = `cd #{ dest_dir } && git rev-parse origin/master`
36
37
with_cvs_repository ( 'cvs' , 'simple' ) do |src_core |
37
38
tmpdir do |dest_dir |
38
39
core = OhlohScm ::Factory . get_core ( scm_type : :git , url : dest_dir )
39
- refute core . status . exist ?
40
+ refute core . status . scm_dir_exist ?
40
41
core . scm . pull ( src_core . scm , TestCallback . new )
42
+ assert core . status . scm_dir_exist?
41
43
assert core . status . exist?
42
44
43
45
dest_commits = core . activity . commits
Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
2
3
3
describe 'Git::Validation' do
4
- it 'must handle non existent remote source' do
5
- core = OhlohScm ::Factory . get_core ( scm_type : :git , url : 'https://github.com/Person/foobar' )
6
- core . validate
7
- core . errors . wont_be :empty?
8
- end
9
-
10
4
it 'wont have errors for valid url' do
11
5
core = OhlohScm ::Factory . get_core ( scm_type : :git , url : 'https://github.com/ruby/ruby' )
12
6
core . validation . send ( :validate_attributes )
You can’t perform that action at this time.
0 commit comments