|
2 | 2 | require 'webmock/rspec'
|
3 | 3 |
|
4 | 4 | describe Fastlane::Helper::InstabugStoresUploadHelper do
|
5 |
| - describe '.fetch_android_build_path' do |
6 |
| - let(:lane_context) { {} } |
7 |
| - |
8 |
| - context 'when all AAB output paths are available' do |
9 |
| - it 'returns all AAB paths with highest priority' do |
10 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS] = ['/path/to/app1.aab', '/path/to/app2.aab'] |
11 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_AAB_OUTPUT_PATH] = '/path/to/single.aab' |
12 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] = ['/path/to/app.apk'] |
13 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH] = '/path/to/single.apk' |
14 |
| - |
15 |
| - result = described_class.fetch_android_build_path(lane_context) |
16 |
| - |
17 |
| - expect(result).to eq(['/path/to/app1.aab', '/path/to/app2.aab']) |
18 |
| - end |
19 |
| - end |
20 |
| - |
21 |
| - context 'when single AAB output path is available' do |
22 |
| - it 'returns single AAB path when all AAB paths are not available' do |
23 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_AAB_OUTPUT_PATH] = '/path/to/app.aab' |
24 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] = ['/path/to/app.apk'] |
25 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH] = '/path/to/single.apk' |
26 |
| - |
27 |
| - result = described_class.fetch_android_build_path(lane_context) |
28 |
| - |
29 |
| - expect(result).to eq('/path/to/app.aab') |
30 |
| - end |
31 |
| - end |
32 |
| - |
33 |
| - context 'when all APK output paths are available' do |
34 |
| - it 'returns all APK paths when AAB paths are not available' do |
35 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] = ['/path/to/app1.apk', '/path/to/app2.apk'] |
36 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH] = '/path/to/single.apk' |
37 |
| - |
38 |
| - result = described_class.fetch_android_build_path(lane_context) |
39 |
| - |
40 |
| - expect(result).to eq(['/path/to/app1.apk', '/path/to/app2.apk']) |
41 |
| - end |
42 |
| - end |
43 |
| - |
44 |
| - context 'when single APK output path is available' do |
45 |
| - it 'returns single APK path when other paths are not available' do |
46 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH] = '/path/to/app.apk' |
47 |
| - |
48 |
| - result = described_class.fetch_android_build_path(lane_context) |
49 |
| - |
50 |
| - expect(result).to eq('/path/to/app.apk') |
51 |
| - end |
52 |
| - end |
53 |
| - |
54 |
| - context 'when no build paths are available' do |
55 |
| - it 'returns nil' do |
56 |
| - result = described_class.fetch_android_build_path(lane_context) |
57 |
| - |
58 |
| - expect(result).to be_nil |
59 |
| - end |
60 |
| - end |
61 |
| - |
62 |
| - context 'when paths are empty strings' do |
63 |
| - it 'returns nil for empty AAB path' do |
64 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_AAB_OUTPUT_PATH] = '' |
65 |
| - |
66 |
| - result = described_class.fetch_android_build_path(lane_context) |
67 |
| - |
68 |
| - expect(result).to be_nil |
69 |
| - end |
70 |
| - |
71 |
| - it 'returns nil for empty APK path' do |
72 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH] = '' |
73 |
| - |
74 |
| - result = described_class.fetch_android_build_path(lane_context) |
75 |
| - |
76 |
| - expect(result).to be_nil |
77 |
| - end |
78 |
| - end |
79 |
| - |
80 |
| - context 'when paths are empty arrays' do |
81 |
| - it 'returns nil for empty all AAB paths' do |
82 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS] = [] |
83 |
| - |
84 |
| - result = described_class.fetch_android_build_path(lane_context) |
85 |
| - |
86 |
| - expect(result).to be_nil |
87 |
| - end |
88 |
| - |
89 |
| - it 'returns nil for empty all APK paths' do |
90 |
| - lane_context[Fastlane::Actions::SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] = [] |
91 |
| - |
92 |
| - result = described_class.fetch_android_build_path(lane_context) |
93 |
| - |
94 |
| - expect(result).to be_nil |
95 |
| - end |
96 |
| - end |
97 |
| - end |
98 |
| - |
99 | 5 | describe '.report_status' do
|
100 | 6 | let(:api_endpoint) { 'https://api.instabug.com/api/web/public/agent_fastlane/status' }
|
101 | 7 |
|
|
0 commit comments