Also test trilogy adapter through activerecord #487
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #486
Since the adapter is in Active Record now, we can test Trilogy through Active Record too. So I just extracted the rails tests and used them both for the mysql2 and trilogy adapter.
Actually at first, I thought maybe the
semian/rails
code isn't too related to the specific adapter, so maybe there's no need to test it for each adapter/client semian supports, but then I saw the code from #395 which is specific to mysql2.By adding a share test we could see the special case made for Mysql2 and reproduce it for Trilogy, but looking more into it, I don't think it's ever used:
and
ActiveRecord::ConnectionAdapters::Mysql2Adapter.new_client
doesn't callsuper
so those exceptions are never rescued/re-raised.Anyway, I can look into this later but this may still be worth it. Let me know what you think.