Module: RSpec::JsonApi::Types

Defined in:
lib/rspec/json_api/types/uri.rb,
lib/rspec/json_api/types/uuid.rb,
lib/rspec/json_api/types/email.rb

Constant Summary collapse

URI =

URI::DEFAULT_PARSER.make_regexp is unanchored, and comparison uses Regexp#match?, so on its own it accepts any string that merely contains a URI ("see https://example.com for details"). \A...\z holds the whole value to the pattern, the same way EMAIL and UUID already are anchored.

/\A#{::URI::DEFAULT_PARSER.make_regexp}\z/
UUID =
/\A[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\z/
EMAIL =
URI::MailTo::EMAIL_REGEXP