Sha256: 6c969ae1fe055bf385b30a9975bb54d10499f3fd20215e31db61b540aad03954

Contents?: true

Size: 584 Bytes

Versions: 1

Compression:

Stored size: 584 Bytes

Contents

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

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

    let(:sys){
      system
    }

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

    let(:ast){
      subject.to_ast
    }

    before do
      sys.add_type(BuiltinType.new(Integer, "Int"))
    end

    let(:input){ 'Int' }

    it 'compiles to a the BuiltinType' do
      compiled.should be_a(BuiltinType)
      compiled.name.should eq("Int")
    end

    it 'has the expected AST' do
      ast.should eq([:type_ref, "Int"])
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qrb-0.3.0 spec/unit/syntax/nodes/test_type_ref.rb