File tree Expand file tree Collapse file tree 2 files changed +6
-26
lines changed Expand file tree Collapse file tree 2 files changed +6
-26
lines changed Original file line number Diff line number Diff line change 69
69
70
70
describe '#source_contents' do
71
71
it 'gets the contents from the secrets repo' do
72
- set_circle_env ( false ) do
73
- allow ( File ) . to receive ( :read ) . with ( subject . secrets_repository_file_path ) . and_return ( 'source contents' )
74
- expect ( subject . source_contents ) . to eq ( 'source contents' )
75
- end
72
+ allow ( FastlaneCore ::Helper ) . to receive ( :is_ci? ) . and_return ( false )
73
+ allow ( File ) . to receive ( :read ) . with ( subject . secrets_repository_file_path ) . and_return ( 'source contents' )
74
+ expect ( subject . source_contents ) . to eq ( 'source contents' )
76
75
end
77
76
end
78
77
79
78
describe '#source_contents on ci' do
80
79
it 'gets the contents from the secrets repo' do
81
- set_circle_env ( true ) do
82
- allow ( File ) . to receive ( :read ) . with ( subject . secrets_repository_file_path ) . and_return ( 'source contents' )
83
- expect ( subject . source_contents ) . to eq ( nil )
84
- end
80
+ allow ( FastlaneCore ::Helper ) . to receive ( :is_ci? ) . and_return ( true )
81
+ allow ( File ) . to receive ( :read ) . with ( subject . secrets_repository_file_path ) . and_return ( 'source contents' )
82
+ expect ( subject . source_contents ) . to eq ( nil )
85
83
end
86
84
end
87
85
Original file line number Diff line number Diff line change @@ -25,24 +25,6 @@ module SpecHelper
25
25
config . filter_run_when_matching :focus
26
26
end
27
27
28
- def set_circle_env ( define_ci )
29
- is_ci = ENV . key? ( 'CIRCLECI' )
30
- orig_circle_ci = ENV [ 'CIRCLECI' ]
31
- if define_ci
32
- ENV [ 'CIRCLECI' ] = 'true'
33
- else
34
- ENV . delete 'CIRCLECI'
35
- end
36
-
37
- yield
38
- ensure
39
- if is_ci
40
- ENV [ 'CIRCLECI' ] = orig_circle_ci
41
- else
42
- ENV . delete 'CIRCLECI'
43
- end
44
- end
45
-
46
28
# Allows Action.sh to be executed even when running in a test environment (where Fastlane's code disables it by default)
47
29
#
48
30
def allow_fastlane_action_sh
You can’t perform that action at this time.
0 commit comments