Sha256: 7db1babcb3f50f57051e21b5ce8e61403c46a04b347a501764703d76bdb1aac2

Contents?: true

Size: 779 Bytes

Versions: 19

Compression:

Stored size: 779 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 eq(true) }
    end

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

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

      it{ should eq(true) }
    end

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

      it{ should eq(false) }
    end

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

      before do
        arg << {a: 12.0}
      end

      it{ should eq(false) }
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
finitio-0.12.0 spec/type/relation_type/test_include.rb
finitio-0.11.4 spec/type/relation_type/test_include.rb
finitio-0.11.3 spec/type/relation_type/test_include.rb
finitio-0.11.2 spec/type/relation_type/test_include.rb
finitio-0.11.1 spec/type/relation_type/test_include.rb
finitio-0.10.0 spec/type/relation_type/test_include.rb
finitio-0.9.1 spec/type/relation_type/test_include.rb
finitio-0.9.0 spec/type/relation_type/test_include.rb
finitio-0.8.0 spec/type/relation_type/test_include.rb
finitio-0.7.0 spec/type/relation_type/test_include.rb
finitio-0.7.0.pre.rc4 spec/type/relation_type/test_include.rb
finitio-0.7.0.pre.rc3 spec/type/relation_type/test_include.rb
finitio-0.7.0.pre.rc2 spec/type/relation_type/test_include.rb
finitio-0.7.0.pre.rc1 spec/type/relation_type/test_include.rb
finitio-0.6.1 spec/type/relation_type/test_include.rb
finitio-0.6.0 spec/type/relation_type/test_include.rb
finitio-0.5.2 spec/type/relation_type/test_include.rb
finitio-0.5.1 spec/type/relation_type/test_include.rb
finitio-0.5.0 spec/type/relation_type/test_include.rb