Sha256: 9b5f6c7661ad55a468047246149c9456946013fc19efdfddbe03438a11b68a49

Contents?: true

Size: 978 Bytes

Versions: 9

Compression:

Stored size: 978 Bytes

Contents

#--
# Cloud Foundry 2012.02.03 Beta
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product includes a number of subcomponents with
# separate copyright notices and license terms. Your use of these
# subcomponents is subject to the terms and conditions of the
# subcomponent's license, as noted in the LICENSE file.
#++

require 'spec_helper'
require 'uaa/http'
require 'uaa/version'

module CF::UAA

describe Http do

  include Http
  include SpecHelper

  it "sets a request handler" do
    set_request_handler do |url, method, body, headers|
      [200, "body", {"content-type" => "text/plain"}]
    end
    status, body, resp_headers = http_get("http://example.com")
    status.should == 200
    body.should == "body"
    resp_headers["content-type"].should == "text/plain"
  end

end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cf-uaa-lib-1.3.10 spec/http_spec.rb
cf-uaa-lib-1.3.9 spec/http_spec.rb
cf-uaa-lib-1.3.8 spec/http_spec.rb
cf-uaa-lib-1.3.7 spec/http_spec.rb
cf-uaa-lib-1.3.6 spec/http_spec.rb
cf-uaa-lib-1.3.5 spec/http_spec.rb
cf-uaa-lib-1.3.4 spec/http_spec.rb
cf-uaa-lib-1.3.3 spec/http_spec.rb
cf-uaa-lib-1.3.2 spec/http_spec.rb