lib/headdesk/checks/facebook.rb in headdesk-0.12.0 vs lib/headdesk/checks/facebook.rb in headdesk-0.13.0
- old
+ new
@@ -27,11 +27,16 @@
sdk_in_use = (facebook_sdks.select do |sdk|
sdk[:major] == major && sdk[:minor] == minor && sdk[:patch] == patch
end).first
- describe "Found Facebook SDK version #{sdk_in_use[:version]}"
- fail_check if: -> { !sdk_in_use }
+ begin
+ describe "Found Facebook SDK version #{sdk_in_use[:version]}"
+ fail_check if: -> { !sdk_in_use }
+ rescue NoMethodError => _e
+ describe "Facebook SDK version #{major}.#{minor}.#{patch} not found, run 'bundle exec bin/facebook_sdk_versions'"
+ fail_check
+ end
export facebook_sdk: sdk_in_use
describe "Facebook SDK was released in the last 2 years (using #{sdk_in_use[:version]}, released #{sdk_in_use[:date]})"
fail_check if: -> { sdk_in_use[:date] < (Date.today - (365 * 2)) }