Module: WithPublic
- Defined in:
- lib/with_public.rb,
lib/with_public/version.rb
Overview
A module to define with_public method to Module class. With this module, one can test private methods without Object#send.
Constant Summary collapse
- VERSION =
'1.0.0'
Instance Method Summary collapse
-
#with_public(*methods) ⇒ Module
Returns a refiner module to make target methods public.
Instance Method Details
#with_public(*methods) ⇒ Module
Returns a refiner module to make target methods public
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/with_public.rb', line 17 def with_public(*methods) target = self Module.new.tap do |refiner| refiner.module_eval do refine target do public(*methods) end end end end |