Closed metacritical closed 2 years ago
Thanks for the comment.
I think there's a misunderstanding here: we're not opening up RSpec
and modifying the behaviour (so-called "monkeypatching") - instead we're defining our own module Pundit::RSpec::Matchers
, which includes behaviour from an RSpec module.
We name the module in this way to make it clear that it contains matchers which are compatible with RSpec
, but the module is completely separate from the RSpec
code.
Does that make sense?
So i was pointed out to the Pundit source, and i am just curious if patching Rspec inside Pundit namespace would be considered "namespace pollution" ? Also what are some merits and demerits to this design approach?