Sha256: 216ce9a58592cb96a67fced6d951eb412f4d395002944658af335bcd34598e9a

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

require 'spec_helper'

module Pacto
  describe URI do
    it 'returns the path appended to the host' do
      uri = URI.for('https://localtest.me', '/bla')
      expect(uri.to_s).to eq 'https://localtest.me/bla'
    end

    it 'uses http as the default scheme for hosts' do
      uri = URI.for('localtest.me', '/bla')
      expect(uri.to_s).to eq 'http://localtest.me/bla'
    end

    it 'shows query parameters if initialized with params' do
      uri = URI.for('localtest.me', '/bla', 'param1' => 'ble')
      expect(uri.to_s).to eq 'http://localtest.me/bla?param1=ble'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pacto-0.3.1 spec/unit/pacto/uri_spec.rb
pacto-0.3.0 spec/unit/pacto/uri_spec.rb