Sha256: 07fa7ff501fa02478e2f5e7526722d24d0d0ffa03289273e84e94eb182ca3de0
Contents?: true
Size: 697 Bytes
Versions: 52
Compression:
Stored size: 697 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 own_expectations self[:expectations] end def own_custom_expectations self[:custom_expectations] end def ensure_expectations_format errors.add :own_expectations, :invalid_format unless own_expectations.to_a.all? { |it| Mulang::Expectation.valid? it } end end
Version data entries
52 entries across 52 versions & 2 rubygems