Sha256: 5b6acfd7862dc27fe5bd04ea8e4b425a0a9ddd084971625be04cbb6f70cd5bb8
Contents?: true
Size: 1.07 KB
Versions: 34
Compression:
Stored size: 1.07 KB
Contents
require 'pact_broker/api/contracts/base_contract' require 'uri' module PactBroker module Api module Contracts class VerificationContract < BaseContract property :success property :provider_version, as: :providerApplicationVersion property :build_url, as: :buildUrl validation do configure do config.messages_file = File.expand_path("../../../locale/en.yml", __FILE__) def not_blank? value value && value.to_s.strip.size > 0 end def valid_url? url URI(url) rescue URI::InvalidURIError, ArgumentError nil end def valid_version_number?(value) parsed_version_number = PactBroker.configuration.version_parser.call(value) !!parsed_version_number end end required(:success).filled(:bool?) required(:provider_version) { not_blank? & valid_version_number? } optional(:build_url).maybe(:valid_url?) end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems