mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -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:
@@ -41,7 +41,16 @@ module ActionController
|
||||
private
|
||||
def define_run_method(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
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user