Sha256: 551d7f20ae277eab4618f1bf8e5104791440e3dea8cbc4367ae7e134e2d22a02
Contents?: true
Size: 674 Bytes
Versions: 8
Compression:
Stored size: 674 Bytes
Contents
# frozen_string_literal: true module Matchers module Type def have_email(attribute, valid_hash = {}) HaveEmailMatcher.new(attribute, valid_hash) end class HaveEmailMatcher < TypeMatcher def initialize(attribute, valid_hash) super(attribute, valid_hash, 'email', 'valid@email.com', 'invalid@email_without_top_domain') @expected_error = "Exception missing for invalid value #{@invalid_value.inspect}" @expected_type = Fortnox::API::Types::Email end private def expected_type? @actual_type = @klass.schema[@attribute] @actual_type == Fortnox::API::Types::Email end end end end
Version data entries
8 entries across 8 versions & 1 rubygems