Sha256: 5cb127747139234a02ecd4d370e3faec6a5e7ab6cea69c001bfe99d03703ae56
Contents?: true
Size: 876 Bytes
Versions: 13
Compression:
Stored size: 876 Bytes
Contents
# frozen_string_literal: true module Rspeckled module Vcr module Matchers class UriWithoutTrailingId attr_accessor :trailing_id_matcher def initialize(trailing_id_matcher) self.trailing_id_matcher = trailing_id_matcher end def call(request, vcr_cassette_request) request_uri = request.uri vcr_cassette_request_uri = vcr_cassette_request.uri if request_uri.match?(trailing_id_matcher) request_uri_without_id = request_uri.sub(trailing_id_matcher, '') vcr_cassette_request_uri_without_id = vcr_cassette_request_uri.sub(trailing_id_matcher, '') request_uri.match(trailing_id_matcher) && vcr_cassette_request_uri.match(trailing_id_matcher) && request_uri_without_id == vcr_cassette_request_uri_without_id else request_uri == vcr_cassette_request_uri end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems