Use instance_eval instead of adding an accessor to the class

This commit is contained in:
Jeremy Kemper
2009-01-07 14:39:23 -08:00
committed by Yehuda Katz
parent cf09fa74f7
commit e3be52c1dd

View File

@@ -146,8 +146,7 @@ class LayoutExceptionRaised < ActionController::TestCase
def test_exception_raised_when_layout_file_not_found
@controller = SetsNonExistentLayoutFile.new
get :hello
@response.template.class.module_eval { attr_accessor :exception }
assert_equal ActionView::MissingTemplate, @response.template.exception.class
assert_kind_of ActionView::MissingTemplate, @response.template.instance_eval { @exception }
end
end