cloudinary / cloudinary_gem

Cloudinary GEM for Ruby on Rails integration
https://cloudinary.com
420 stars 285 forks source link

Added helper function to ensure add on tests do not run by default #432

Closed YomesInc closed 3 years ago

YomesInc commented 3 years ago

Brief Summary of Changes

Added should_test_addon() which can be used to determine whether a certain addon should be tested and allow skipping those that shouldn't.

To enable certain addon testing, add its id to the CLD_TEST_ADDONS environment variable. Alternatively set CLD_TEST_ADDONS to all to test all add ons.

This can be used in a test spec like so:

it "should support requesting ocr analysis", should_test_addon: Helpers::AddonType::ADDON_OCR do
  expect(something).to be(something)
end

Alternatively, it can be used inside a test's code to skip some of it. For example:

if Helpers::IntegrationTestCaseHelper.should_test_addon(Helpers::AddonType::ADDON_WEBPURIFY
  # Test addon
end

What does this PR address?

Are tests included?

Reviewer, Please Note:

Consider adding CLD_TEST_ADDONS=all to Travis.