Sha256: c1c609decf843d5866d13735dc2bbfd0d6b62e008b650443c5f386d04859bc09

Contents?: true

Size: 442 Bytes

Versions: 2

Compression:

Stored size: 442 Bytes

Contents

require 'spec_helper'
module Qrb
  describe Syntax, "union_type" do

    subject{
      Syntax.parse(input, root: "union_type")
    }

    let(:compiled){
      subject.compile(type_factory)
    }

    context '.Integer|.Float' do
      let(:input){ '.Integer|.Float' }

      it 'compiles to a UnionType' do
        compiled.should be_a(UnionType)
        compiled.should eq(UnionType.new([intType, floatType]))
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qrb-0.2.0 spec/unit/syntax/nodes/test_union_type.rb
qrb-0.1.0 spec/unit/syntax/nodes/test_union_type.rb