Sha256: 7bdbf349af8c1306a42cab883f5eb8115cbfbbbc391332a1c8007087b4ea2e9c

Contents?: true

Size: 648 Bytes

Versions: 3

Compression:

Stored size: 648 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

module Pacto
  describe RequestPattern do
    let(:http_method) { :get  }
    let(:uri_pattern) { double }
    let(:request_pattern) { double }
    let(:request) { double(http_method: http_method) }

    it 'returns a pattern that combines the contracts http_method and uri_pattern' do
      expect(UriPattern).to receive(:for).
        with(request).
        and_return(uri_pattern)

      expect(Pacto::RequestPattern).to receive(:new).
        with(http_method, uri_pattern).
        and_return(request_pattern)

      expect(RequestPattern.for(request)).to eq request_pattern
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pacto-0.4.0.rc3 spec/unit/pacto/request_pattern_spec.rb
pacto-0.4.0.rc2 spec/unit/pacto/request_pattern_spec.rb
pacto-0.4.0.rc1 spec/unit/pacto/request_pattern_spec.rb