Sha256: 34156e215e2da1b53f8604825d4d81bce23697ee56fe3594a592b7261a7b7995

Contents?: true

Size: 627 Bytes

Versions: 2

Compression:

Stored size: 627 Bytes

Contents

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

    let(:heading){
      Heading.new([Attribute.new(:a, intType)])
    }

    context 'with a valid heading' do
      subject{ TupleType.new(heading) }

      it{ should be_a(TupleType) }

      it 'correctly sets the instance variable' do
        subject.heading.should eq(heading)
      end
    end

    context 'with an invalid heading' do
      subject{ TupleType.new("foo") }

      it 'should raise an error' do
        ->{
          subject
        }.should raise_error(ArgumentError, "Heading expected, got `foo`")
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finitio-0.4.1 spec/unit/type/tuple_type/test_initialize.rb
finitio-0.4.0 spec/unit/type/tuple_type/test_initialize.rb