In a gem, I define a spec helper module that needs to be included in RSpec config.
Initially, we decided to let the user require the module file and to include it explicitly in RSpec.configure block.
Now we are going to change this behavior and automatically include our module:
# spec/support/my_mod.rb
module MyMod
# ...
end
RSpec.configure do |config|
config.include MyMod
end
Is there a way to check if our module is already included in RSpec's config? Checking Configuration docs, I don't see a method that could help here.
UPDATE: I have just realised that this is an uncommon scenario, because it's useless to check if the module is already included in the module file itself - the manual inclusion in the app happens later :(