aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/plugins/vendored_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-25 22:59:08 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-25 22:59:08 +0100
commit02908e11425069e5b91cbf8ec3c8344a58493ef8 (patch)
tree29e713a53211774691e2cd6f2fa5dd629fd5ae27 /railties/test/plugins/vendored_test.rb
parent1177a40e68b6661d6d2cb4aefdd9a805459cd936 (diff)
downloadrails-02908e11425069e5b91cbf8ec3c8344a58493ef8.tar.gz
rails-02908e11425069e5b91cbf8ec3c8344a58493ef8.tar.bz2
rails-02908e11425069e5b91cbf8ec3c8344a58493ef8.zip
As first step setup the load path and lazy compare middlewares.
Diffstat (limited to 'railties/test/plugins/vendored_test.rb')
-rw-r--r--railties/test/plugins/vendored_test.rb38
1 files changed, 18 insertions, 20 deletions
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