aruba icon indicating copy to clipboard operation
aruba copied to clipboard

Use RSpec annotations instead of included class to trigger RSpec hooks

Open mvz opened this issue 2 years ago • 1 comments
trafficstars

Summary

Use type: :aruba to trigger all RSpec hooks in the default integration, replacing the check for inclusion of Aruba::Api.

Details

When using the default aruba/rspec integration, the initial inclusion of Aruba::Api was triggered by a type: :aruba annotation to the spec, but the other hooks were filtered by a check for inclusion of Aruba::Api.

Since we already use :type to trigger inclusion of Aruba::Api, we can safely use it to activate the around hooks as well, thus simplifying the code

This also increases safety for custom integrations, since having those work correctly depended on "aruba/rspec" never being loaded.

Motivation and Context

This improves simplicity of the code by relying on existing mechanisms instead of introducing our own.

How Has This Been Tested?

CI will check this

Types of changes

  • (Maybe) bug fix (non-breaking change which fixes an issue)
  • Internal change (refactoring, test improvements, developer experience or update of dependencies)

mvz avatar Dec 25 '22 11:12 mvz

Needs work since the specs secretly relied on the hooks in aruba/rspec 😢

mvz avatar Dec 25 '22 14:12 mvz