Tests: Ruby hooks.
This commit is contained in:
7
test/ruby/hooks/config.ru
Normal file
7
test/ruby/hooks/config.ru
Normal file
@@ -0,0 +1,7 @@
|
||||
app = Proc.new do |env|
|
||||
['200', {
|
||||
'Content-Length' => '0'
|
||||
}, ['']]
|
||||
end
|
||||
|
||||
run app
|
||||
3
test/ruby/hooks/eval.rb
Normal file
3
test/ruby/hooks/eval.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
require 'securerandom'
|
||||
|
||||
File.write("./cookie_eval.#{SecureRandom.hex}", "evaluated")
|
||||
9
test/ruby/hooks/multiple.rb
Normal file
9
test/ruby/hooks/multiple.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
require 'securerandom'
|
||||
|
||||
on_worker_boot do
|
||||
File.write("./cookie_worker_boot.#{SecureRandom.hex}", "worker booted")
|
||||
end
|
||||
|
||||
on_thread_boot do
|
||||
File.write("./cookie_thread_boot.#{SecureRandom.hex}", "thread booted")
|
||||
end
|
||||
5
test/ruby/hooks/on_thread_boot.rb
Normal file
5
test/ruby/hooks/on_thread_boot.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'securerandom'
|
||||
|
||||
on_thread_boot do
|
||||
File.write("./cookie_thread_boot.#{SecureRandom.hex}", "booted")
|
||||
end
|
||||
5
test/ruby/hooks/on_thread_shutdown.rb
Normal file
5
test/ruby/hooks/on_thread_shutdown.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'securerandom'
|
||||
|
||||
on_thread_shutdown do
|
||||
File.write("./cookie_thread_shutdown.#{SecureRandom.hex}", "shutdown")
|
||||
end
|
||||
5
test/ruby/hooks/on_worker_boot.rb
Normal file
5
test/ruby/hooks/on_worker_boot.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'securerandom'
|
||||
|
||||
on_worker_boot do
|
||||
File.write("./cookie_worker_boot.#{SecureRandom.hex}", "booted")
|
||||
end
|
||||
5
test/ruby/hooks/on_worker_shutdown.rb
Normal file
5
test/ruby/hooks/on_worker_shutdown.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'securerandom'
|
||||
|
||||
on_worker_shutdown do
|
||||
File.write("./cookie_worker_shutdown.#{SecureRandom.hex}", "shutdown")
|
||||
end
|
||||
Reference in New Issue
Block a user