diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-02-28 05:17:23 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-02-28 05:17:23 +0000 |
commit | 4e5132f63a210beb766ebfe52bea7424903403ae (patch) | |
tree | fcfe703d96887d990a1b5afb7f4df8f02f666bb0 /test | |
parent | 658f730c922e0ad3a5bb60ecf292831b6e6f4b75 (diff) | |
download | unicorn-4e5132f63a210beb766ebfe52bea7424903403ae.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@64 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test')
-rw-r--r-- | test/plugins/commands/test1.rb | 21 | ||||
-rw-r--r-- | test/test_plugins.rb | 30 | ||||
-rw-r--r-- | test/test_uriclassifier.rb | 6 |
3 files changed, 56 insertions, 1 deletions
diff --git a/test/plugins/commands/test1.rb b/test/plugins/commands/test1.rb new file mode 100644 index 0000000..b999d38 --- /dev/null +++ b/test/plugins/commands/test1.rb @@ -0,0 +1,21 @@ + +include Mongrel + +class First < Plugin "/commands" + def initialize(options = {}) + puts "First with options: #{options.inspect}" + end +end + +class Second < Plugin "/commands" + def initialize(options = {}) + puts "Second with options: #{options.inspect}" + end +end + +class Last < 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 new file mode 100644 index 0000000..680dac5 --- /dev/null +++ b/test/test_plugins.rb @@ -0,0 +1,30 @@ +require 'test/unit' +require 'mongrel' + + +include Mongrel + +class PluginTest < Test::Unit::TestCase + + def setup + @pmgr = PluginManager.instance + @categories = ["/commands"] + @names = ["FirstCommand", "SecondCommand", "LastCommands"] + end + + def test_load_plugins + @pmgr.load(File.join(File.dirname(__FILE__),"plugins")) + puts "#{@pmgr.available.inspect}" + @pmgr.available.each {|cat,plugins| + plugins.each do |p| + puts "TEST: #{cat}/#{p}" + assert @names.include?(p) + end + } + + @pmgr.available.each do |name| + plugin = @pmgr.create(name, options={"name" => name}) + end + end + +end diff --git a/test/test_uriclassifier.rb b/test/test_uriclassifier.rb index b9b2778..f7c104b 100644 --- a/test/test_uriclassifier.rb +++ b/test/test_uriclassifier.rb @@ -30,7 +30,9 @@ class URIClassifierTest < Test::Unit::TestCase assert val != nil, "didn't resolve" assert_equal prefix,sn, "wrong script name" assert_equal test[sn.length .. -1],pi, "wrong path info" - + + assert u.inspect != nil, "No inspect for classifier" + assert u.uris[0] == prefix, "URI list didn't match" end def test_not_finding @@ -172,5 +174,7 @@ class URIClassifierTest < Test::Unit::TestCase assert_equal root,sn, "didn't get right script name" assert_equal 1,h, "didn't find handler" end + + end |