aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/middleware_stack_test.rb
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2009-02-20 10:50:21 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-20 10:50:21 -0600
commit53fe301a42f9d18b4a8a475e9babf64c621369ae (patch)
tree32ba2bc4e148c607bbdae56b74c3eb9c6762f86c /actionpack/test/controller/middleware_stack_test.rb
parent9702636a08e50e9fed9bf76ad620a6a0a109009e (diff)
downloadrails-53fe301a42f9d18b4a8a475e9babf64c621369ae.tar.gz
rails-53fe301a42f9d18b4a8a475e9babf64c621369ae.tar.bz2
rails-53fe301a42f9d18b4a8a475e9babf64c621369ae.zip
Lazy evaluate middleware arguments [#2028 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/controller/middleware_stack_test.rb')
-rw-r--r--actionpack/test/controller/middleware_stack_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/middleware_stack_test.rb b/actionpack/test/controller/middleware_stack_test.rb
index 612a710fa7..918231013a 100644
--- a/actionpack/test/controller/middleware_stack_test.rb
+++ b/actionpack/test/controller/middleware_stack_test.rb
@@ -80,4 +80,11 @@ class MiddlewareStackTest < ActiveSupport::TestCase
end
assert_equal BazMiddleware, @stack.last.klass
end
+
+ test "lazy evaluates middleware arguments" do
+ assert_difference "@stack.size" do
+ @stack.use BazMiddleware, lambda { :foo }
+ end
+ assert_equal [:foo], @stack.last.send(:build_args)
+ end
end