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
We have a number of tests that will pass in object_double([class]) when we are running specs for our Rails application, but these all fail on the Types.Instance([class]) checks we are using. As it is difficult to add an option for a test double, since these classes are not even loaded in production environments, there is not an easy way to skip these type checks when needed.
It would be great if we could pass in an extra option to ignore the type checking in certain scenarios. Something like option :arg, type: Types.Instance(Foo), ignore_type: Rails.env.test? would be ideal.
The text was updated successfully, but these errors were encountered:
I don't think we should add this settings directly into dry-initializer just because this seems like an edge case on far edge. This is a "bad news"
But there's a good news too :)
Option definition is actually extensible via dispatchers. This means you can insert your own setting to option and param.
I would recommend you to read the dispatchers class with its sublcasses to look at how exactly they are implemented. Then you should possibly read dry-initializer-rails as an example of adding new setting.
We have a number of tests that will pass in
object_double([class])
when we are running specs for our Rails application, but these all fail on theTypes.Instance([class])
checks we are using. As it is difficult to add an option for a test double, since these classes are not even loaded in production environments, there is not an easy way to skip these type checks when needed.It would be great if we could pass in an extra option to ignore the type checking in certain scenarios. Something like
option :arg, type: Types.Instance(Foo), ignore_type: Rails.env.test?
would be ideal.The text was updated successfully, but these errors were encountered: