提交 f3531a8f 编写于 作者: J José Valim

Clean up details keys before some tests to expire the cache.

上级 38703ac8
......@@ -59,6 +59,10 @@ def self.get(details)
@details_keys[details] ||= new
end
def self.clear
@details_keys.clear
end
def initialize
@hash = object_hash
end
......
......@@ -3,6 +3,10 @@
class CompiledTemplatesTest < Test::Unit::TestCase
def setup
# Clean up any details key cached to expose failures
# that otherwise would appear just on isolated tests
ActionView::LookupContext::DetailsKey.clear
@compiled_templates = ActionView::CompiledTemplates
@compiled_templates.instance_methods.each do |m|
@compiled_templates.send(:remove_method, m) if m =~ /^_render_template_/
......
require "abstract_unit"
require "abstract_controller/rendering"
ActionView::LookupContext::DetailsKey.class_eval do
def self.details_keys
@details_keys
end
end
class LookupContextTest < ActiveSupport::TestCase
def setup
@lookup_context = ActionView::LookupContext.new(FIXTURE_LOAD_PATH, {})
ActionView::LookupContext::DetailsKey.clear
end
def teardown
I18n.locale = :en
ActionView::LookupContext::DetailsKey.details_keys.clear
end
test "process view paths on initialization" do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册