1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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