@@ -159,5 +159,30 @@ def run_with args
159159 expect ( Kernel ) . to receive ( :system ) . with ( "#{ custom_cli_path } upload dsym --api-key #{ api_key } --project-root #{ Dir ::pwd } \" #{ FIXTURE_PATH } \" " ) . and_return ( true )
160160 run_with ( { dsym_path : FIXTURE_PATH , api_key : api_key , bugsnag_cli_path : custom_cli_path } )
161161 end
162+
163+ it 'logs a warning when using an outdated CLI version' do
164+ cli_path = File . join ( FIXTURE_PATH , 'dummy_bugsnag_cli.sh' )
165+ bundled_bugsnag_cli_version = `#{ BUGSNAG_CLI_PATH } --version` . strip
166+ allow ( Fastlane ::Actions ::UploadSymbolsToBugsnagAction ) . to receive ( :version_from_cli ) . and_return ( "1.0.0" )
167+ allow ( Fastlane ::Actions ::UploadSymbolsToBugsnagAction ) . to receive ( :bundled_bugsnag_cli_version ) . and_return ( bundled_bugsnag_cli_version )
168+
169+ expect ( Fastlane ::UI ) . to receive ( :warning ) . with ( "Your bugsnag-cli is outdated. The current bugsnag-cli version is: #{ bundled_bugsnag_cli_version } " )
170+ expect ( Kernel ) . to receive ( :system ) . with ( "#{ cli_path } upload dsym --project-root #{ Dir ::pwd } \" #{ FIXTURE_PATH } \" " ) . and_return ( true )
171+
172+ run_with ( { dsym_path : FIXTURE_PATH , bugsnag_cli_path : cli_path } )
173+ end
174+
175+ it 'logs doesnt log a warning when using an newer CLI version' do
176+ cli_version = "9.9.9"
177+ cli_path = File . join ( FIXTURE_PATH , 'dummy_bugsnag_cli.sh' )
178+ bundled_bugsnag_cli_version = `#{ BUGSNAG_CLI_PATH } --version` . strip
179+ allow ( Fastlane ::Actions ::UploadSymbolsToBugsnagAction ) . to receive ( :version_from_cli ) . and_return ( cli_version )
180+ allow ( Fastlane ::Actions ::UploadSymbolsToBugsnagAction ) . to receive ( :bundled_bugsnag_cli_version ) . and_return ( bundled_bugsnag_cli_version )
181+
182+ expect ( Fastlane ::UI ) . not_to receive ( :warning )
183+
184+ ENV [ 'BUGSNAG_CLI_VERSION' ] = cli_version
185+ run_with ( { dsym_path : FIXTURE_PATH , bugsnag_cli_path : cli_path } )
186+ end
162187 end
163188end
0 commit comments