Sha256: 93264a6eeb72f23177ec74b184fbdec8ab05fb17fcd806c0c24b1625c3ba46e1

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/env ruby
#
#  Created by Rick Bradley on 2007-10-03.
#  Copyright (c) 2007. All rights reserved.

require File.dirname(__FILE__) + '/../../spec_helper'

require 'puppet/network/http'

describe Puppet::Network::HTTP do
  it "should return the webrick HTTP server class when asked for a webrick server" do
    Puppet::Network::HTTP.server_class_by_type(:webrick).should be(Puppet::Network::HTTP::WEBrick)
  end

  describe "when asked for a mongrel server" do
    if Puppet.features.mongrel?
      it "should return the mongrel server class" do
        Puppet::Network::HTTP.server_class_by_type(:mongrel).should be(Puppet::Network::HTTP::Mongrel)
      end
    else
      it "should fail" do
        lambda { Puppet::Network::HTTP.server_class_by_type(:mongrel) }.should raise_error(ArgumentError)
      end
    end
  end

  it "should fail to return the mongrel HTTP server class if mongrel is not available " do
    Puppet.features.expects(:mongrel?).returns(false)
    Proc.new { Puppet::Network::HTTP.server_class_by_type(:mongrel) }.should raise_error(ArgumentError)
  end

  it "should return an error when asked for an unknown server" do
    Proc.new { Puppet::Network::HTTP.server_class_by_type :foo }.should raise_error(ArgumentError)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
puppet-2.6.18 spec/unit/network/http_spec.rb
puppet-2.6.17 spec/unit/network/http_spec.rb
puppet-2.6.16 spec/unit/network/http_spec.rb
puppet-2.6.15 spec/unit/network/http_spec.rb
puppet-2.6.14 spec/unit/network/http_spec.rb
puppet-2.6.13 spec/unit/network/http_spec.rb
puppet-2.6.12 spec/unit/network/http_spec.rb
puppet-2.6.11 spec/unit/network/http_spec.rb
puppet-2.6.10 spec/unit/network/http_spec.rb
puppet-2.6.9 spec/unit/network/http_spec.rb
puppet-2.6.8 spec/unit/network/http_spec.rb
puppet-2.6.7 spec/unit/network/http_spec.rb
puppet-2.6.6 spec/unit/network/http_spec.rb
puppet-2.6.5 spec/unit/network/http_spec.rb
puppet-2.6.4 spec/unit/network/http_spec.rb
puppet-2.6.3 spec/unit/network/http_spec.rb
puppet-2.6.2 spec/unit/network/http_spec.rb
puppet-2.6.1 spec/unit/network/http_spec.rb
puppet-2.6.0 spec/unit/network/http_spec.rb