Sha256: 5771bd24dfa5f077bda35ae499bf46a3315c81d188cdf61fb42a0156fef3b546

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

# -*- coding: utf-8 -*-
require_relative '../../spec_helper'

describe 'DataMapper::Validations::ViolationSet' do
  before :all do
    @model = DataMapper::Validations::ViolationSet.new(Object.new)
  end

  describe "initially" do
    it "is empty" do
      expect(@model).to be_empty
    end
  end

  # Not sure if this is worth having at all,
  # just keeping old spec suite bits in place
  # if they make no harm — MK
  describe "after enquiry" do
    before :all do
      @model.on(:property)
    end

    it "is still empty" do
      expect(@model).to be_empty
    end
  end


  describe "after errors being added" do
    before :all do
      @model.add(:property, "can't be valid, no way")
    end

    it "is no longer empty" do
      expect(@model).not_to be_empty
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sbf-dm-validations-1.4.0 spec/unit/violation_set/emptiness_spec.rb
sbf-dm-validations-1.3.0 spec/unit/violation_set/emptiness_spec.rb
sbf-dm-validations-1.3.0.beta spec/unit/violation_set/emptiness_spec.rb