Sha256: fc7d9dbafa2367b6197c79a7326e8de63c75583f4f8c036a74c8df2d463b854e

Contents?: true

Size: 676 Bytes

Versions: 2

Compression:

Stored size: 676 Bytes

Contents

require 'helper'

class RequestHarness; include Footrest::Request; end

describe Footrest::Request do
  let(:request) { RequestHarness.new }
  context "join" do
    it "retains initial slash" do
      expect(request.join('/test', 'path')).to eq('/test/path')
    end

    it "combines multiple segments" do
      expect(request.join('test', 'path', 'parts')).to eq('test/path/parts')
    end

    it "respects http://" do
      expect(request.join('http://', 'path')).to eq('http://path')
    end

    it "keeps slashes within strings" do
      expect(request.join('http://', 'domain', '/path/to/something')).
        to eq('http://domain/path/to/something')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
footrest-0.1.3 spec/footrest/request_spec.rb
footrest-0.1.2 spec/footrest/request_spec.rb