Closed jonolsson closed 7 years ago
Thanks @jonolsson, hitted the exact same problem today and was about to open an issue here 😉 that's exactly the root cause.
IMHO, specs should be using a Dry::Container
instance as the container instead of a hash because, AFAIK, no example in the documentation uses a hash as the container.
Thanks @jonolsson for creating the issue. I would love to see that PR. I just check the specs and we test that all steps are local but we did not test for that case when we actually pass a Container
https://github.com/dry-rb/dry-transaction/blob/master/spec/integration/transaction_spec.rb#L159-L180
Thanks for the report @jonolsson! I have a moment now so I'm taking a look at this.
@jonolsson your fix as described here looks good, will be happy to accept your PR once it's ready, thanks!
Nice, I have submitted the PR now.
Fixed in #64
Using locally defined steps and at the same time as using Dry::Container for other steps fails due to Dry::Container throwing an exception when the step can't be resolved.
Results in:
Can be fixed by changing lib/dry/transaction/operation_resolver.rb line 8 to:
I have a PR ready to be submitted for this change.