Sha256: 82d68c53f8526ac72fd6146a604cfdccfb702b494123eb9a1748c14013141680

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

require 'spec_helper'
module Qrb
  describe RelationType, "initialize" do

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

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

      it{ should be_a(RelationType) }
    end

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

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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qrb-0.3.0 spec/unit/type/relation_type/test_initialize.rb
qrb-0.2.0 spec/unit/type/relation_type/test_initialize.rb
qrb-0.1.0 spec/unit/type/relation_type/test_initialize.rb