Sha256: 21b14532dff99c3271237317f7447e81e32a54b6eea64f8dda148068bcde9886
Contents?: true
Size: 601 Bytes
Versions: 13
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true module GrpcMock class RequestPattern # @param path [String] def initialize(path) @path = path @block = nil @request = nil end def with(request = nil, &block) if request.nil? && !block_given? raise ArgumentError, '#with method invoked with no arguments. Either options request or block must be specified.' end @request = request @block = block end def match?(path, request) @path == path && (@request.nil? || @request == request) && (@block.nil? || @block.call(path)) end end end
Version data entries
13 entries across 13 versions & 3 rubygems