source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/monkey_patches/publicize_methods.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 8 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

  • Property svn:executable set to *
File size: 400 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2# Some monkey-patching to allow us to test private methods.
3class Class
4 def publicize_methods(*methods)
5 saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods
6
7 self.class_eval { public(*saved_private_instance_methods) }
8 yield
9 self.class_eval { private(*saved_private_instance_methods) }
10 end
11end
Note: See TracBrowser for help on using the repository browser.