Sha256: 6d0d9e266b5fd3f533eeaa749a9e63fb0513290dd3a2df00572402bebfe7e1fb

Contents?: true

Size: 461 Bytes

Versions: 3

Compression:

Stored size: 461 Bytes

Contents

require 'cgi'

describe "CGI::QueryExtension#host" do
  before(:each) do
    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
    @cgi = CGI.new
  end

  after(:each) do
    ENV['REQUEST_METHOD'] = @old_request_method
  end

  it "returns ENV['HTTP_HOST']" do
    old_value, ENV['HTTP_HOST'] = ENV['HTTP_HOST'], "localhost"
    begin
      @cgi.host.should == "localhost"
    ensure
      ENV['HTTP_HOST'] = old_value
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-cgi-1.0.0 spec/queryextension/host_spec.rb
rubysl-cgi-2.0.1 spec/queryextension/host_spec.rb
rubysl-cgi-2.0.0 spec/queryextension/host_spec.rb