Sha256: 9cbd903e7332f10114be5db2357f9e731c8a1bcaefb0d889882366519d03a046
Contents?: true
Size: 736 Bytes
Versions: 71
Compression:
Stored size: 736 Bytes
Contents
module RSpectacular module ActiveRecord module Matchers class TruthfulnessMatcher < Shoulda::ActiveRecord::Matchers::ValidationMatcher def matches?(truthable) super(truthable) allows_true && allows_false && disallows_nil end def allows_true allows_value_of(true) end def allows_false allows_value_of(false) end def disallows_nil disallows_value_of(nil) end def description "should accept only boolean true or false values" end end def validate_truthfulness_of(truthteller) TruthfulnessMatcher.new(truthteller) end end end end
Version data entries
71 entries across 71 versions & 1 rubygems