@@ -88,7 +88,7 @@ def expect_bundletool_call(aab, apk, *options)
88
88
run_described_fastlane_action (
89
89
apk_output_file_path : apk_output_file_path
90
90
)
91
- end . to raise_error ( described_class ::NO_AAB_ERROR_MESSAGE )
91
+ end . to raise_error ( FastlaneCore :: Interface :: FastlaneError , described_class ::NO_AAB_ERROR_MESSAGE )
92
92
93
93
Fastlane ::Actions . lane_context [ Fastlane ::Actions ::SharedValues ::GRADLE_ALL_AAB_OUTPUT_PATHS ] = nil
94
94
end
@@ -122,38 +122,35 @@ def expect_bundletool_call(aab, apk, *options)
122
122
describe 'error handling' do
123
123
it 'errors if bundletool is not installed' do
124
124
allow ( Fastlane ::Action ) . to receive ( 'sh' ) . with ( 'command' , '-v' , 'bundletool' , any_args ) . and_raise
125
- expect ( Fastlane ::UI ) . to receive ( :user_error! ) . with ( described_class ::MISSING_BUNDLETOOL_ERROR_MESSAGE ) . and_raise
126
125
127
126
expect do
128
127
run_described_fastlane_action (
129
128
aab_file_path : aab_file_path ,
130
129
apk_output_file_path : apk_output_file_path
131
130
)
132
- end . to raise_error ( RuntimeError )
131
+ end . to raise_error ( FastlaneCore :: Interface :: FastlaneError , described_class :: MISSING_BUNDLETOOL_ERROR_MESSAGE )
133
132
end
134
133
135
134
it 'errors if no input AAB file was provided nor can be inferred' do
136
135
expect ( Fastlane ::Action ) . to receive ( 'sh' ) . with ( 'command' , '-v' , 'bundletool' , any_args )
137
- expect ( Fastlane ::UI ) . to receive ( :user_error! ) . with ( described_class ::NO_AAB_ERROR_MESSAGE ) . and_raise
138
136
139
137
expect do
140
138
run_described_fastlane_action (
141
139
apk_output_file_path : apk_output_file_path
142
140
)
143
- end . to raise_error ( RuntimeError )
141
+ end . to raise_error ( FastlaneCore :: Interface :: FastlaneError , described_class :: NO_AAB_ERROR_MESSAGE )
144
142
end
145
143
146
144
it 'errors if the provided input AAB file does not exist' do
147
145
expect ( Fastlane ::Action ) . to receive ( 'sh' ) . with ( 'command' , '-v' , 'bundletool' , any_args )
148
146
allow ( File ) . to receive ( :file? ) . with ( aab_file_path ) . and_return ( false )
149
- expect ( Fastlane ::UI ) . to receive ( :user_error! ) . with ( "The file `#{ aab_file_path } ` was not found. Please provide a path to an existing file." ) . and_raise
150
147
151
148
expect do
152
149
run_described_fastlane_action (
153
150
aab_file_path : aab_file_path ,
154
151
apk_output_file_path : apk_output_file_path
155
152
)
156
- end . to raise_error ( RuntimeError )
153
+ end . to raise_error ( FastlaneCore :: Interface :: FastlaneError , "The file ` #{ aab_file_path } ` was not found. Please provide a path to an existing file." )
157
154
end
158
155
end
159
156
end
0 commit comments