Sha256: 1c0e75f6abad91f4927785d83e80d3489d11f99d47b50112529a22447c856184
Contents?: true
Size: 629 Bytes
Versions: 43
Compression:
Stored size: 629 Bytes
Contents
module WithExpectations extend ActiveSupport::Concern included do serialize :expectations, Array validate :ensure_expectations_format end def expectations_yaml self.expectations.to_yaml end def expectations_yaml=(yaml) self.expectations = YAML.load yaml end def expectations=(expectations) self[:expectations] = expectations.map(&:stringify_keys) end def raw_expectations self[:expectations] end def ensure_expectations_format errors.add :raw_expectations, :invalid_format unless raw_expectations.to_a.all? { |it| Mulang::Expectation.valid? it } end end
Version data entries
43 entries across 43 versions & 1 rubygems