Sha256: 23b6b36fb903f1ea19d1fbc461007f980f96c6ae983e72aa2026d3cedecdc877

Contents?: true

Size: 561 Bytes

Versions: 19

Compression:

Stored size: 561 Bytes

Contents

require 'spec_helper'
module Finitio
  describe UnionType, "initialize" do

    context 'with valid candidates' do
      let(:union){ UnionType.new([intType, floatType]) }

      it 'sets the variable instances' do
        expect(union.candidates).to eq([intType, floatType])
      end
    end

    context 'with invalid candidates' do
      let(:union){ UnionType.new(["bar"]) }

      it 'should raise an error' do
        expect{
          union
        }.to raise_error(ArgumentError, %Q{[Finitio::Type] expected, got ["bar"]})
      end
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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