Sha256: e5b42ffea629bb6fd729b460308fbf05573aff5f219c4d00f7a98a8d0bc96da5

Contents?: true

Size: 932 Bytes

Versions: 26

Compression:

Stored size: 932 Bytes

Contents

require "spec_helper"

# @note This is going to be part of fog-xml eventually
describe Fog::XML::Connection do
  before do
    @connection = Fog::XML::Connection.new("http://localhost")
  end

  after do
    Excon.stubs.clear
  end

  it "responds to #request" do
    assert_respond_to @connection, :request
  end

  describe "when request is passed a parser" do
    it "returns the body after parsing" do
      @parser = Fog::ToHashDocument.new
      Excon.stub({}, { :status => 200, :body => "<xml></xml>" })
      response = @connection.request(:parser => @parser, :mock => true)
      assert_equal({ :xml => "" }, response.body)
    end
  end

  describe "when request excludes a parser" do
    it "returns the response body without change" do
      Excon.stub({}, { :status => 200, :body => "<xml></xml>" })
      response = @connection.request(:mock => true)
      assert_equal("<xml></xml>", response.body)
    end
  end
end

Version data entries

26 entries across 24 versions & 5 rubygems

Version Path
fog-2.3.0 spec/fog/xml/connection_spec.rb
fog-ifeel-2.2.0 spec/fog/xml/connection_spec.rb
fog-2.2.0 spec/fog/xml/connection_spec.rb
fog-2.1.0 spec/fog/xml/connection_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/spec/fog/xml/connection_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/spec/fog/xml/connection_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/spec/fog/xml/connection_spec.rb
fog-1.42.1 spec/fog/xml/connection_spec.rb
fog-2.0.0 spec/fog/xml/connection_spec.rb
fog-1.42.0 spec/fog/xml/connection_spec.rb
fog-1.41.0 spec/fog/xml/connection_spec.rb
fog-1.40.0 spec/fog/xml/connection_spec.rb
fog-1.39.0 spec/fog/xml/connection_spec.rb
fog-digitalocean-0.1.0 spec/fog/xml/connection_spec.rb
fog-1.38.0 spec/fog/xml/connection_spec.rb
fog-1.37.0 spec/fog/xml/connection_spec.rb
fog-1.36.0 spec/fog/xml/connection_spec.rb
fog-1.35.0 spec/fog/xml/connection_spec.rb
fog-2.0.0.pre.0 spec/fog/xml/connection_spec.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/spec/fog/xml/connection_spec.rb