Sha256: 4f6b51bab4673a2dbc558bb21e37c4557e2408b44b293b564b8ba657838fc90e
Contents?: true
Size: 602 Bytes
Versions: 12
Compression:
Stored size: 602 Bytes
Contents
require "addressable/uri" module WildcardMatchers module Matchers def is_uri(hash = {}) IsUri.new(hash) end class IsUri < ::WildcardMatchers::WildcardMatcher protected def wildcard_match(actual) unless actual return errors.push "#{position}: expect URI but nil" end uri = ::Addressable::URI.parse(actual) # if actual is ::URI re-parse expectation.each do |key, value| errors.push(*self.class.superclass.check_errors(uri.__send__(key), value, position + "[#{key.inspect}]")) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems