Skip to content

Conversation

@mcmire
Copy link
Collaborator

@mcmire mcmire commented Mar 26, 2023

When writing tests for a project that uses certain parts of Rails, it should still be possible to say require "super_diff/rails", and SuperDiff should only load the integrations that correspond to the available parts. Right now the only two integrations are ActiveSupport and ActiveRecord. ActiveSupport should always be available, but ActiveRecord may not be available, so this commit adds a guard around that integration in particular. It also adds tests for Combustion so we can test that this guard specifically works for engines where ActiveRecord is not being loaded.

When writing tests for a project that uses certain parts of Rails, it
should still be possible to say `require "super_diff/rails"`, and
SuperDiff should only load the integrations that correspond to the
available parts. Right now the only two integrations are ActiveSupport
and ActiveRecord. ActiveSupport should always be available, but
ActiveRecord may not be available, so this commit adds a guard around
that integration in particular. It also adds tests for Combustion so we
can test that this guard specifically works for engines where
ActiveRecord is not being loaded.

Co-authored-by: Harry Lascelles <[email protected]>
Co-authored-by: sshaw <[email protected]>
@mcmire mcmire merged commit 37cedd6 into main Mar 26, 2023
@mcmire mcmire deleted the dont-require-ar-if-unavailable branch March 26, 2023 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant