]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/stdlib/spec/monkey_patches/publicize_methods.rb
upgrade to concat 2.0.0
[dsa-puppet.git] / modules / stdlib / spec / monkey_patches / publicize_methods.rb
1 # Some monkey-patching to allow us to test private methods.
2 class Class
3     def publicize_methods(*methods)
4         saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods
5
6         self.class_eval { public(*saved_private_instance_methods) }
7         yield
8         self.class_eval { private(*saved_private_instance_methods) }
9     end
10 end
11