From f9be7efc758795f1ace12ed495667d5b501cbb2b Mon Sep 17 00:00:00 2001 From: Marc PEREZ Date: Wed, 14 Jul 2021 16:36:33 +0200 Subject: [PATCH] Added another test (will squash later) --- spec/aws_sns_action_spec.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/spec/aws_sns_action_spec.rb b/spec/aws_sns_action_spec.rb index 687aa39..f9e9f92 100644 --- a/spec/aws_sns_action_spec.rb +++ b/spec/aws_sns_action_spec.rb @@ -11,14 +11,33 @@ aws_sns_client: aws_sns_client, platform: 'FCM', platform_name: 'FCM_SNS_PLATFORM_APP', - platform_fcm_server_key: 'PLACEHOLDER_FCM_KEY', - attributes_override: {} + platform_fcm_server_key: 'PLACEHOLDER_FCM_KEY' }) end ").runner.execute(:test) expect(result).to eq("String") end + + it 'raises an error if no AWS client can be created' do + expect do + Fastlane::FastFile.new.parse(" + lane :test do + + # Just in case they are set + ENV.delete('AWS_SNS_ACCESS_KEY') + ENV.delete('AWS_SNS_SECRET_ACCESS_KEY') + ENV.delete('AWS_SNS_REGION') + + arn = aws_sns({ + platform: 'FCM', + platform_name: 'FCM_SNS_PLATFORM_APP', + platform_fcm_server_key: 'PLACEHOLDER_FCM_KEY' + }) + end + ").runner.execute(:test) + end.to raise_error(FastlaneCore::Interface::FastlaneError) + end end end end