diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-01-13 18:40:34 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-01-13 19:44:44 -0200 |
commit | c159b01b85ac3955c53cd6b8a62d5d90ee973cfb (patch) | |
tree | 09c50c90942e50d27b6f05ffc07eec9f1600a9d4 /actionpack/test/dispatch/reloader_test.rb | |
parent | 4ca3592f86c01f265633038887af9c3c511b4022 (diff) | |
download | rails-c159b01b85ac3955c53cd6b8a62d5d90ee973cfb.tar.gz rails-c159b01b85ac3955c53cd6b8a62d5d90ee973cfb.tar.bz2 rails-c159b01b85ac3955c53cd6b8a62d5d90ee973cfb.zip |
Use a BodyProxy instead of including a Module that responds to close.
Closes #4441 if Active Record is disabled assets are delivered correctly
Diffstat (limited to 'actionpack/test/dispatch/reloader_test.rb')
-rw-r--r-- | actionpack/test/dispatch/reloader_test.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/reloader_test.rb b/actionpack/test/dispatch/reloader_test.rb index 3411bd14ea..df66e88cb1 100644 --- a/actionpack/test/dispatch/reloader_test.rb +++ b/actionpack/test/dispatch/reloader_test.rb @@ -43,6 +43,16 @@ class ReloaderTest < Test::Unit::TestCase assert_respond_to body, :close end + def test_returned_body_object_always_responds_to_close_even_if_called_twice + body = call_and_return_body + assert_respond_to body, :close + body.close + + body = call_and_return_body + assert_respond_to body, :close + body.close + end + def test_condition_specifies_when_to_reload i, j = 0, 0, 0, 0 Reloader.to_prepare { |*args| i += 1 } @@ -154,7 +164,8 @@ class ReloaderTest < Test::Unit::TestCase private def call_and_return_body(&block) - @reloader ||= Reloader.new(block || proc {[200, {}, 'response']}) + @response ||= 'response' + @reloader ||= Reloader.new(block || proc {[200, {}, @response]}) @reloader.call({'rack.input' => StringIO.new('')})[2] end end |