Preserve integration session's request_count

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2008-01-23 08:37:58 +00:00
parent 8273280a63
commit 2cd8424aae
1 changed files with 10 additions and 1 deletions

View File

@ -41,7 +41,16 @@ module ActionController
private private
def define_run_method(script_path) def define_run_method(script_path)
script = File.read(script_path) script = File.read(script_path)
source = "def run\n#{script}\nreset!\nend"
source = <<-end_source
def run
#{script}
old_request_count = request_count
reset!
self.request_count = old_request_count
end
end_source
instance_eval source, script_path, 1 instance_eval source, script_path, 1
end end