File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,8 @@ def setup_enterprise
108
108
endpoint
109
109
end
110
110
self . api_endpoint = c [ enterprise_name ]
111
- self . insecure = true if insecure . nil?
111
+ self . insecure = insecure unless insecure . nil?
112
+ self . session . ssl . delete :ca_file
112
113
endpoint_config [ 'enterprise' ] = true
113
114
@setup_ennterpise = true
114
115
end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe Travis ::CLI ::ApiCommand do
4
+ describe 'enterprise' do
5
+ travis_config_path = ENV [ 'TRAVIS_CONFIG_PATH' ]
6
+
7
+ before do
8
+ ENV [ 'TRAVIS_CONFIG_PATH' ] = File . expand_path '../support' , File . dirname ( __FILE__ )
9
+ config = subject . send ( :load_file , 'fake_travis_config.yml' )
10
+ subject . config = YAML . load ( config )
11
+
12
+ subject . api_endpoint = 'https://travis-ci-enterprise/api'
13
+ subject . enterprise_name = 'default'
14
+ end
15
+
16
+ after do
17
+ ENV [ 'TRAVIS_CONFIG_PATH' ] = travis_config_path
18
+ end
19
+
20
+ describe '#setup_enterprise' do
21
+ before do
22
+ subject . send ( :setup_enterprise )
23
+ end
24
+
25
+ it 'keeps verifying peers' do
26
+ subject . insecure . should be_falsey
27
+ end
28
+
29
+ it 'uses default CAs' do
30
+ subject . session . ssl . should_not include ( :ca_file )
31
+ end
32
+
33
+ it 'flags endpoint' do
34
+ subject . endpoint_config . should include ( 'enterprise' => true )
35
+ end
36
+ end
37
+ end
38
+ end
Original file line number Diff line number Diff line change @@ -10,3 +10,5 @@ endpoints:
10
10
access_token : fake-travis-com-token
11
11
https://api.travis-ci.org/ :
12
12
access_token : fake-travis-org-token
13
+ https://travis-ci-enterprise/api :
14
+ access_token : fake-travis-enterprise-token
You can’t perform that action at this time.
0 commit comments