diff options
author | José Valim <jose.valim@gmail.com> | 2010-05-29 22:29:14 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-29 22:29:46 +0200 |
commit | 19d8c8cbe4aae570e3b48080e3182e5634aa7aec (patch) | |
tree | 4916366ccf706c49f7e2082a406a2a90471dff79 /actionpack/test/dispatch | |
parent | d7f6f2b596d00a7deb4f83592aaa78436c5c3163 (diff) | |
download | rails-19d8c8cbe4aae570e3b48080e3182e5634aa7aec.tar.gz rails-19d8c8cbe4aae570e3b48080e3182e5634aa7aec.tar.bz2 rails-19d8c8cbe4aae570e3b48080e3182e5634aa7aec.zip |
Remove the laziness from the middleware stack.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/middleware_stack_test.rb | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/actionpack/test/dispatch/middleware_stack_test.rb b/actionpack/test/dispatch/middleware_stack_test.rb index 7cf6365af3..170c5b8565 100644 --- a/actionpack/test/dispatch/middleware_stack_test.rb +++ b/actionpack/test/dispatch/middleware_stack_test.rb @@ -66,29 +66,14 @@ class MiddlewareStackTest < ActiveSupport::TestCase assert_equal BazMiddleware, @stack[0].klass end - test "active returns all only enabled middleware" do - assert_no_difference "@stack.active.size" do - assert_difference "@stack.size" do - @stack.use BazMiddleware, :if => lambda { false } - end - end - end - test "lazy evaluates middleware class" do assert_difference "@stack.size" do - @stack.use lambda { BazMiddleware } + @stack.use "MiddlewareStackTest::BazMiddleware" 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 - - test "lazy compares so unloaded constants can be loaded" do + test "lazy compares so unloaded constants are not loaded" do @stack.use "UnknownMiddleware" @stack.use :"MiddlewareStackTest::BazMiddleware" assert @stack.include?("::MiddlewareStackTest::BazMiddleware") |