Created
February 12, 2009 16:43
-
-
Save thedarkone/62713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup | |
@compiled_templates = ActionView::Base::CompiledTemplates | |
# first, if we are running the whole test suite with ReloadableTemplates | |
# try to undef all the methods through ReloadableTemplate's interfaces | |
unless ActionView::Base.cache_template_loading? | |
ActionController::Base.view_paths.each do |view_path| | |
view_path.paths.values.uniq!.each do |reloadable_template| | |
reloadable_template.undef_my_compiled_methods! | |
end | |
end | |
end | |
# just purge anything that's left | |
@compiled_templates.instance_methods.each do |m| | |
@compiled_templates.send(:remove_method, m) if m =~ /^_run_/ | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment