mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
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
This commit is contained in:
parent
9d120bf9b5
commit
89719a8b28
2 changed files with 21 additions and 21 deletions
|
@ -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
|
||||
|
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue