Sha256: 5f45ad8bd126b34677c588425fe1a03d77b1e143da8a2ac1735ecc83e40bd6e8

Contents?: true

Size: 715 Bytes

Versions: 13

Compression:

Stored size: 715 Bytes

Contents

require 'spec_helper'
describe Infoblox::Connection do

  ["localhost", "127.0.0.1", "http://localhost:3000", "https://localhost", "http://localhost:3000/"].each do |host|
    it "should build URL without failure" do
      conn_params = {
        username: "billy", 
        password: "boi",
        host:     host
      }
      uri = "/wapi/v1.0/record:host"

      ic = Infoblox::Connection.new(conn_params)
      ic.adapter       = :test
      ic.adapter_block = stub_get(uri)

      # execute the request. There should be no "URI::BadURIError: both URI are relative" error
      ic.get(uri)
    end
  end

  def stub_get(uri)
    Proc.new do |stub|
      stub.get(uri) { [ 200, {}, 'Yay!'] } 
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
infoblox-0.2.15 spec/connection_spec.rb
infoblox-0.2.14 spec/connection_spec.rb
infoblox-0.2.13 spec/connection_spec.rb
infoblox-0.2.12 spec/connection_spec.rb
infoblox-0.2.11 spec/connection_spec.rb
infoblox-0.2.9 spec/connection_spec.rb
infoblox-0.2.8 spec/connection_spec.rb
infoblox-0.2.7 spec/connection_spec.rb
infoblox-0.2.6 spec/connection_spec.rb
infoblox-0.2.5 spec/connection_spec.rb
infoblox-0.2.4 spec/connection_spec.rb
infoblox-0.2.3 spec/connection_spec.rb
infoblox-0.2.2 spec/connection_spec.rb