Sha256: a40cba0c1a41e3cf481003fec076d596885cff3943aef51e11784beaa450df1e
Contents?: true
Size: 364 Bytes
Versions: 20
Compression:
Stored size: 364 Bytes
Contents
# frozen_string_literal: true require 'uri' RSpec::Matchers.define :have_query_param do |key| match do |url| query_params_from(url)[key].present? end def query_params_from(url) Hash[query_for(url).split('&').map { |xxx| xxx.split('=', 2) }] end def uri_for(url) URI.parse(url) end def query_for(url) uri_for(url).query end end
Version data entries
20 entries across 20 versions & 1 rubygems