method
making_declared_methods_public
1.3.0 -
Show latest stable
-
0 notes -
Class: Spec::Matchers::Matcher
- 1.1.4
- 1.1.12
- 1.2.0
- 1.2.8 (0)
- 1.3.0 (0)
- 1.3.1 (0)
- What's this?
making_declared_methods_public(# :nodoc:)
private
Hide source
# File lib/spec/matchers/matcher.rb, line 93 def making_declared_methods_public # :nodoc: # Our home-grown instance_exec in ruby 1.8.6 results in any methods # declared in the block eval'd by instance_exec in the block to which we # are yielding here are scoped private. This is NOT the case for Ruby # 1.8.7 or 1.9. # # Also, due some crazy scoping that I don't understand, these methods # are actually available in the specs (something about the matcher being # defined in the scope of Spec::Matchers or within an example), so not # doing the following will not cause specs to fail, but they *will* # cause features to fail and that will make users unhappy. So don't. orig_private_methods = private_methods yield st = (class << self; self; end) (private_methods - orig_private_methods).each {|m| st.__send__ :public, m} end