From 02908e11425069e5b91cbf8ec3c8344a58493ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 25 Jan 2010 22:59:08 +0100 Subject: As first step setup the load path and lazy compare middlewares. --- railties/test/plugins/vendored_test.rb | 38 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'railties/test/plugins/vendored_test.rb') diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/plugins/vendored_test.rb index 41073d33a2..c14178ec66 100644 --- a/railties/test/plugins/vendored_test.rb +++ b/railties/test/plugins/vendored_test.rb @@ -48,6 +48,7 @@ module PluginsTest RUBY boot_rails + assert $foo end test "plugin paths get added to the AS::Dependency list" do @@ -252,26 +253,6 @@ YAML assert_equal "FooMetal", last_response.body end - test "use plugin middleware in application config" do - plugin "foo" do |plugin| - plugin.write "lib/foo.rb", <<-RUBY - class Foo - def initialize(app) - @app = app - end - - def call(env) - @app.call(env) - end - end - RUBY - end - - add_to_config "config.middleware.use :Foo" - - boot_rails - end - test "namespaced controllers with namespaced routes" do @plugin.write "config/routes.rb", <<-RUBY ActionController::Routing::Routes.draw do @@ -332,6 +313,23 @@ YAML assert rescued, "Expected boot rails to fail" end + + test "use plugin middleware in application config" do + @plugin.write "lib/bukkits.rb", <<-RUBY + class Bukkits + def initialize(app) + @app = app + end + + def call(env) + @app.call(env) + end + end + RUBY + + add_to_config "config.middleware.use \"Bukkits\"" + boot_rails + end end class VendoredOrderingTest < Test::Unit::TestCase -- cgit v1.2.3