Sha256: dfd4687680313126e3799058386c3a81de3db217f9d817f9b4f5652f68f98b78

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'
module Finitio
  describe RelationType, "include?" do

    let(:heading){
      Heading.new([Attribute.new(:a, intType)])
    }

    let(:type){ RelationType.new(heading) }

    subject{ type.include?(arg) }

    context 'when a empty set' do
      let(:arg){ Set.new }

      it{ should be_true }
    end

    context 'when a valid, non empty set' do
      let(:arg){ Set.new }

      before do
        arg << {a: 12} << {a: 15}
      end

      it{ should be_true }
    end

    context 'when not a set' do
      let(:arg){ "foo" }

      it{ should be_false }
    end

    context 'when a set containing invalid tuples' do
      let(:arg){ Set.new }

      before do
        arg << {a: 12.0}
      end

      it{ should be_false }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finitio-0.4.1 spec/unit/type/relation_type/test_include.rb
finitio-0.4.0 spec/unit/type/relation_type/test_include.rb