1: Have you tried to require a file in a before :each block?
require 'my_module'
2: I do not know if reloading the file is correct. From what it seems to you, all you need is some class values ββthat will become standard again, because I just create a method that modifies the module values ββanyway.
describe MyModule do def module_to_default MyModule.setting = :some_default_value end before :each do module_to_default end end
If you well understand the use of the values ββof this module in your code, it might be a good idea to move the method to the module itself.
source share