diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-02 22:52:56 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-03 02:16:50 -0700 |
commit | 86ba0068f138af96ca7ddd177c0c300b12f513a9 (patch) | |
tree | 240e644086997a956dfe461adcefc0e7b21e67de /test/unit | |
parent | d964d8966c316fb224e37c3a98345622f3bd0cd7 (diff) | |
download | unicorn-86ba0068f138af96ca7ddd177c0c300b12f513a9.tar.gz |
Premade lambda/proc/Proc objects may all be passed, to the hooks, not just anonymous blocks.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/test_configurator.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/test_configurator.rb b/test/unit/test_configurator.rb index 284d727..46fc248 100644 --- a/test/unit/test_configurator.rb +++ b/test/unit/test_configurator.rb @@ -91,4 +91,19 @@ class TestConfigurator < Test::Unit::TestCase end end + def test_after_fork_proc + [ proc { |a,b| }, Proc.new { |a,b| }, lambda { |a,b| } ].each do |my_proc| + Unicorn::Configurator.new(:after_fork => my_proc).commit!(self) + assert_equal my_proc, @after_fork + end + end + + def test_after_fork_wrong_arity + [ proc { |a| }, Proc.new { }, lambda { |a,b,c| } ].each do |my_proc| + assert_raises(ArgumentError) do + Unicorn::Configurator.new(:after_fork => my_proc) + end + end + end + end |