Sha256: 8dc884e1e9adca70f5d5b1ba564698c19303964ce6ba78f71680dfdbfb3d84a9

Contents?: true

Size: 400 Bytes

Versions: 6

Compression:

Stored size: 400 Bytes

Contents

#! /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

        self.class_eval { public(*saved_private_instance_methods) }
        yield
        self.class_eval { private(*saved_private_instance_methods) }
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-retrospec-0.12.1 spec/fixtures/modules/stdlib/spec/monkey_patches/publicize_methods.rb
puppet-retrospec-0.12.0 spec/fixtures/modules/stdlib/spec/monkey_patches/publicize_methods.rb
puppet-retrospec-0.11.0 spec/fixtures/modules/stdlib/spec/monkey_patches/publicize_methods.rb
puppet-retrospec-0.10.0 spec/fixtures/modules/stdlib/spec/monkey_patches/publicize_methods.rb
puppet-retrospec-0.9.1 spec/fixtures/modules/stdlib/spec/monkey_patches/publicize_methods.rb
puppet-retrospec-0.9.0 spec/fixtures/modules/stdlib/spec/monkey_patches/publicize_methods.rb