X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Fmonkey_patches%2Fpublicize_methods.rb;h=70cf4f0561b0b51e21dfa09f817b02b648376fe4;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=3ae59f978b63db5cc35a0d27d7722ab08862b62e;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/monkey_patches/publicize_methods.rb b/3rdparty/modules/stdlib/spec/monkey_patches/publicize_methods.rb old mode 100755 new mode 100644 index 3ae59f978..70cf4f056 --- a/3rdparty/modules/stdlib/spec/monkey_patches/publicize_methods.rb +++ b/3rdparty/modules/stdlib/spec/monkey_patches/publicize_methods.rb @@ -1,11 +1,10 @@ -#! /usr/bin/env ruby -S rspec # Some monkey-patching to allow us to test private methods. class Class - def publicize_methods(*methods) - saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods + def publicize_methods(*methods) + saved_private_instance_methods = methods.empty? ? private_instance_methods : methods - self.class_eval { public(*saved_private_instance_methods) } - yield - self.class_eval { private(*saved_private_instance_methods) } - end + class_eval { public(*saved_private_instance_methods) } + yield + class_eval { private(*saved_private_instance_methods) } + end end