Sha256: 5d1b5f5ebb4de10ebc5fd04bdfe36096e13c0249201ed7daba275366e932ad30

Contents?: true

Size: 1.12 KB

Versions: 33

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env rspec
require '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

33 entries across 33 versions & 3 rubygems

Version Path
puppet-2.7.26 spec/unit/network/http_spec.rb
puppet-2.7.25 spec/unit/network/http_spec.rb
puppet-2.7.24 spec/unit/network/http_spec.rb
puppet-2.7.23 spec/unit/network/http_spec.rb
puppet-2.7.22 spec/unit/network/http_spec.rb
puppet-2.7.21 spec/unit/network/http_spec.rb
puppet-2.7.20 spec/unit/network/http_spec.rb
puppet-2.7.20.rc1 spec/unit/network/http_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/network/http_spec.rb
puppet-2.7.19 spec/unit/network/http_spec.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/network/http_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/network/http_spec.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/network/http_spec.rb
puppet-2.7.18 spec/unit/network/http_spec.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/network/http_spec.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/network/http_spec.rb
puppet-2.7.17 spec/unit/network/http_spec.rb
puppet-2.7.16 spec/unit/network/http_spec.rb
puppet-2.7.14 spec/unit/network/http_spec.rb
puppet-2.7.13 spec/unit/network/http_spec.rb