From 89719a8b28f728c0ce4891cc5d6a70e63dd0d700 Mon Sep 17 00:00:00 2001 From: zedshaw Date: Sun, 5 Mar 2006 08:03:08 +0000 Subject: No need for external files to test plugin loading. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@81 19e92222-5c0b-0410-8929-a290d50e31e9 --- test/plugins/commands/test1.rb | 19 ------------------- test/test_plugins.rb | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 test/plugins/commands/test1.rb diff --git a/test/plugins/commands/test1.rb b/test/plugins/commands/test1.rb deleted file mode 100644 index b8c0d89..0000000 --- a/test/plugins/commands/test1.rb +++ /dev/null @@ -1,19 +0,0 @@ - -class First < Mongrel::Plugin "/commands" - def initialize(options = {}) - puts "First with options: #{options.inspect}" - end -end - -class Second < Mongrel::Plugin "/commands" - def initialize(options = {}) - puts "Second with options: #{options.inspect}" - end -end - -class Last < Mongrel::Plugin "/commands" - def initialize(options = {}) - puts "Last with options: #{options.inspect}" - end -end - diff --git a/test/test_plugins.rb b/test/test_plugins.rb index 2f3ec3f..8658793 100644 --- a/test/test_plugins.rb +++ b/test/test_plugins.rb @@ -4,6 +4,24 @@ require 'mongrel' class ATestPlugin < Mongrel::Plugin "/stuff" end +class First < Mongrel::Plugin "/commands" + def initialize(options = {}) + puts "First with options: #{options.inspect}" + end +end + +class Second < Mongrel::Plugin "/commands" + def initialize(options = {}) + puts "Second with options: #{options.inspect}" + end +end + +class Last < Mongrel::Plugin "/commands" + def initialize(options = {}) + puts "Last with options: #{options.inspect}" + end +end + include Mongrel @@ -12,11 +30,12 @@ class PluginTest < Test::Unit::TestCase def setup @pmgr = PluginManager.instance @categories = ["/commands"] - @names = ["/first","/second","/last", "/atestplugin"] + @names = ["/first", "/second", "/last", "/atestplugin"] end def test_load_plugins - @pmgr.load(File.join(File.dirname(__FILE__),"plugins")) + @pmgr.load + puts "#{@pmgr.available.inspect}" @pmgr.available.each {|cat,plugins| plugins.each do |p| -- cgit v1.2.3-24-ge0c7