Sha256: 2a8ddc9543a211920fd4bb2e83cf894d2201d8b6233b4ab4e8ef51809629bbb6
Contents?: true
Size: 739 Bytes
Versions: 4
Compression:
Stored size: 739 Bytes
Contents
require 'remarkable/active_model' module Remarkable module ActiveModel module Matchers class DomainNameMatcher < Remarkable::ActiveModel::Base arguments :domain_name collection_assertions :accept_valid_value?, :reject_valid_value? protected def accept_valid_value? @subject.domain_name = 'example.com' @subject.valid?.errors[:domain_name].should == [] end def reject_valid_value? @subject.domain_name = 'example' @subject.valid?.errors[:domain_name].should == ['is invalid'] end end def require_a_valid_domain_name(*args, &block) DomainNameMatcher.new(*args, &block).spec(self) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems