Sha256: 9cf4ac0cb36a281bf62f4e975accf7cd714ef3b69db46ac127bc823558ec5f9c

Contents?: true

Size: 652 Bytes

Versions: 4

Compression:

Stored size: 652 Bytes

Contents

require 'spec_helper'
module Alf
  describe Relvar, 'not_empty!' do
    include Relvar

    subject{ not_empty! }

    context 'on an empty relvar' do
      let(:to_cog){ [] }

      it "should raise a fact error" do
        lambda{ subject }.should raise_error(Alf::FactAssertionError)
      end
    end

    context 'on an non empty relvar' do
      let(:to_cog){ [ 1 ] }

      it{ should be(self) }
    end

    context 'on an empty relvar with an error message' do
      let(:to_cog){ [] }

      it "should raise a fact error" do
        lambda{ not_empty!("foo") }.should raise_error(Alf::FactAssertionError, /foo/)
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-relvar/shared/test_not_empty_bang.rb
alf-core-0.14.0 spec/unit/alf-relvar/shared/test_not_empty_bang.rb
alf-core-0.13.1 spec/unit/alf-relvar/shared/test_not_empty_bang.rb
alf-core-0.13.0 spec/unit/alf-relvar/shared/test_not_empty_bang.rb