rubocop-rspec
rubocop-rspec copied to clipboard
`FilePath` rule option to ignore module?
I sometimes like to use a top-level application module to namespace internal stuff for clarity, but I don't really want to have to nest my specs under that directory. It would be nice if there was some option to allow ignoring certain modules when resolving the path. For example:
# class
module MyApp
module Matchers
class HaveTask
# code here
end
end
end
# spec
describe MyApp::Matchers::HaveTask do
# tests here
end
For the above class HaveTask
, I would want to have the spec file in spec/matchers/have_task_spec.rb
, but the FilePath
rule requires that it goes under spec/my_app/matchers/have_task_spec.rb
.