I ran into an problem writing a test with a stubbed container value where the container in question was empty when the test is run in isolation. This caused a hard-to-find issue where some code in dry-transaction was calling #key? on the container, and it was returning false even though a stubbed value had been registered.
Is this something that should be supported, or is the current code right to assume that only existing registered values can be stubbed?
If we allow non-registered values to be stubbed, I think we'll either need a different approach to stubbing or the stubbing API will need to be fleshed out to better support the full API of Dry::Container::Mixin.
I ran into an problem writing a test with a stubbed container value where the container in question was empty when the test is run in isolation. This caused a hard-to-find issue where some code in
dry-transaction
was calling#key?
on the container, and it was returningfalse
even though a stubbed value had been registered.Is this something that should be supported, or is the current code right to assume that only existing registered values can be stubbed?
If we allow non-registered values to be stubbed, I think we'll either need a different approach to stubbing or the stubbing API will need to be fleshed out to better support the full API of
Dry::Container::Mixin
.