Skip to content

Instantly share code, notes, and snippets.

@thedarkone
Created February 12, 2009 16:43
Show Gist options
  • Save thedarkone/62713 to your computer and use it in GitHub Desktop.
Save thedarkone/62713 to your computer and use it in GitHub Desktop.
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