Sha256: 781dbe3486cb015684e5f69957b91fd2f5d3f59a1a659dfbd6a52b8e33cf2e5c

Contents?: true

Size: 705 Bytes

Versions: 3

Compression:

Stored size: 705 Bytes

Contents

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

    subject{ Heading.new(attributes) }

    context 'with no attribute' do
      let(:attributes){
        [ ]
      }

      it{ should be_a(Heading) }
    end

    context 'with valid attributes' do
      let(:attributes){
        [ Attribute.new(:red, intType) ]
      }

      it{ should be_a(Heading) }
    end

    context 'with invalid attributes' do
      let(:attributes){
        [ Attribute.new(:red, intType), Attribute.new(:red, intType) ]
      }

      it 'should raise an error' do
        ->{
          subject
        }.should raise_error(ArgumentError, "Attribute names must be unique")
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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