pairing with luke, nagios_command provider skeleton
[vinpup.git] / spec / unit / network / http.rb
blob79a0a88d422e8a763ce0be0246b8b55f6b7aba74
1 #!/usr/bin/env ruby
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)
13     end
14     
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)
18         end
19     end
20     
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)
24     end
25     
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)
28     end
29 end