Hello,
I have an issue with dry-system enable_stubs method, it causes my test to fail with the following snippet:
An error occurred while loading ./spec/policies/user_policy_spec.rb.
Failure/Error: LeRegistreApi::Container.enable_stubs!
FrozenError:
can't modify frozen Class: LeRegistreApi::Container
# /home/tyflomate/.gem/gems/dry-core-1.0.0/lib/dry/core/container/stub.rb:52:in `extend_object'
# /home/tyflomate/.gem/gems/dry-core-1.0.0/lib/dry/core/container/stub.rb:52:in `extend'
# /home/tyflomate/.gem/gems/dry-core-1.0.0/lib/dry/core/container/stub.rb:52:in `enable_stubs!'
# /home/tyflomate/.gem/gems/dry-system-1.0.1/lib/dry/system/stubs.rb:33:in `enable_stubs!'
# ./spec/rails_helper.rb:25:in `<top (required)>'
# /home/tyflomate/.gem/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
# /home/tyflomate/.gem/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
# /home/tyflomate/.gem/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
# ./spec/policies/user_policy_spec.rb:3:in `<top (required)>'
No examples found.
Finished in 0.00003 seconds (files took 4.4 seconds to load)
0 examples, 0 failures, 125 errors occurred outside of examples
Here is my rails_helper: y752w - Ghostbin
And my container initializer: r3zak - Ghostbin.
What is weird is that on my other computer it works correctly. I tried uninstalling all my ruby versions/gems/rbenv and reinstalling but still have the issue. I don’t know what could cause that, I hope you can help ! Thanks a lot