You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
************************************************************************
Warning from shoulda-matchers:
The `with` qualifier on `define_enum_for` is deprecated and will be
removed in the next major release. Please use `with_values` instead.
************************************************************************
However, because the deprecated method (with) is called in the code that declares the test cases, not called from within a test, DeprecationToolkit won't catch this deprecation. The deprecation gets logged before attach_subscriber has been invoked.
Is it possible to subscribe to deprecations earlier in the life of the test process?
The text was updated successfully, but these errors were encountered:
👋 I dug a bit on this issue, it's non trivial to fix since Minitest will init the plugin only only during the ruby at_exit hook https://github.com/seattlerb/minitest/blob/e6bc4485730403faff6966c1671cf5de72b2d233/lib/minitest.rb#L53 (way after the class and any class method call happen).
For now I don't have a solution without monkypatching minitest which I want to avoid. Will keep the issue open for now and find when I have the time if there is a better alternative.
Consider this example of a deprecation warning:
https://github.com/thoughtbot/shoulda-matchers/blob/94b28e4ef4cc001b1c0b4386143b8c05ac163550/lib/shoulda/matchers/warn.rb#L20-L25
A test like this would trigger that deprecation:
Here's what gets logged:
However, because the deprecated method (
with
) is called in the code that declares the test cases, not called from within a test,DeprecationToolkit
won't catch this deprecation. The deprecation gets logged beforeattach_subscriber
has been invoked.Is it possible to subscribe to deprecations earlier in the life of the test process?
The text was updated successfully, but these errors were encountered: