diff options
author | Luke Kanies <luke@madstop.com> | 2008-07-16 22:00:38 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-07-17 13:08:33 +1000 |
commit | 7fa7251e30dfefc95dda6ef82181d4346f36880d (patch) | |
tree | 38850331af675c3ab7cde7c19e2e226471311f60 /lib | |
parent | bdbd992a6f5ff9628682179639923214d09a780c (diff) | |
download | puppet-7fa7251e30dfefc95dda6ef82181d4346f36880d.tar.gz puppet-7fa7251e30dfefc95dda6ef82181d4346f36880d.tar.xz puppet-7fa7251e30dfefc95dda6ef82181d4346f36880d.zip |
The mongrel-related tests now run without mongrel.
Here were the main changes necessary:
* Fixed the class loader so it only loads mongrel if it's available.
* Fixed the test runner to skip example groups contained in non-runnable
example groups.
* Fixed the Mongrel tests to use quoted class names instead of constants,
since the constants themselves would be absent.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/network/http.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/puppet/network/http.rb b/lib/puppet/network/http.rb index 062c67c71..c219859b6 100644 --- a/lib/puppet/network/http.rb +++ b/lib/puppet/network/http.rb @@ -1,13 +1,15 @@ class Puppet::Network::HTTP def self.server_class_by_type(kind) - return Puppet::Network::HTTP::WEBrick if kind.to_sym == :webrick - if kind.to_sym == :mongrel + case kind.to_sym + when :webrick: + require 'puppet/network/http/webrick' + return Puppet::Network::HTTP::WEBrick + when :mongrel: raise ArgumentError, "Mongrel is not installed on this platform" unless Puppet.features.mongrel? + require 'puppet/network/http/mongrel' return Puppet::Network::HTTP::Mongrel + else + raise ArgumentError, "Unknown HTTP server name [#{kind}]" end - raise ArgumentError, "Unknown HTTP server name [#{kind}]" end end - -require 'puppet/network/http/webrick' -require 'puppet/network/http/mongrel' |