Sha256: 41850ac288af96ab3e526c27c6144b7e04297c71c891766e9116f88c1ee56c9f

Contents?: true

Size: 838 Bytes

Versions: 2

Compression:

Stored size: 838 Bytes

Contents

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

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

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

    context 'empty heading' do
      let(:input){ '  ' }

      it 'compiles to a Heading' do
        compiled.should be_a(Heading)
        compiled.to_name.should eq('')
      end
    end

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

      it 'compiles to a Heading' do
        compiled.should be_a(Heading)
        compiled.to_name.should eq('a: Integer')
      end
    end

    context 'a: .Integer, b: .Float' do
      let(:input){ 'a: .Integer, b: .Float' }

      it 'compiles to a Heading' do
        compiled.should be_a(Heading)
        compiled.to_name.should eq('a: Integer, b: Float')
      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_heading.rb
qrb-0.1.0 spec/unit/syntax/nodes/test_heading.rb