diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/initializer.rb | 2 | ||||
-rw-r--r-- | railties/test/fixtures/plugins/default/stubby/init.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index e412091d18..31edd69f46 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -286,7 +286,7 @@ module Rails # Raises <tt>LoadError</tt> if the plugin is not found. def load_plugin(directory) name = File.basename(directory) - return false if loaded_plugins.include?(directory) + return false if loaded_plugins.include?(name) # Catch nonexistent and empty plugins. raise LoadError, "No such plugin: #{directory}" unless plugin_path?(directory) diff --git a/railties/test/fixtures/plugins/default/stubby/init.rb b/railties/test/fixtures/plugins/default/stubby/init.rb index fc9470fd97..81beeb0d32 100644 --- a/railties/test/fixtures/plugins/default/stubby/init.rb +++ b/railties/test/fixtures/plugins/default/stubby/init.rb @@ -1,2 +1,7 @@ +# I have access to my directory and the Rails config. +raise 'directory expected but undefined in init.rb' unless defined? directory +raise 'config expected but undefined in init.rb' unless defined? config + +# My lib/ dir must be in the load path. require 'stubby_mixin' -raise unless defined? StubbyMixin +raise 'missing mixin from my lib/ dir' unless defined? StubbyMixin |