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

Last change on this file since 30960 was 30960, checked in by davidb, 7 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

  • 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.