3 # Created by Rick Bradley on 2007-10-03.
4 # Copyright (c) 2007. All rights reserved.
6 require File.dirname(__FILE__) + '/../../spec_helper'
8 require 'puppet/network/http'
10 describe Puppet::Network::HTTP do
11 it "should return the webrick HTTP server class when asked for a webrick server" do
12 Puppet::Network::HTTP.server_class_by_type(:webrick).should be(Puppet::Network::HTTP::WEBrick)
15 if Puppet.features.mongrel?
16 it "should return the mongrel HTTP server class when asked for a mongrel server" do
17 Puppet::Network::HTTP.server_class_by_type(:mongrel).should be(Puppet::Network::HTTP::Mongrel)
21 it "should fail to return the mongrel HTTP server class if mongrel is not available " do
22 Puppet.features.expects(:mongrel?).returns(false)
23 Proc.new { Puppet::Network::HTTP.server_class_by_type(:mongrel) }.should raise_error(ArgumentError)
26 it "should return an error when asked for an unknown server" do
27 Proc.new { Puppet::Network::HTTP.server_class_by_type :foo }.should raise_error(ArgumentError)