Sha256: 02ec91910f80ab90430b70039e78df79722428bdcf50f9acc5048bbf6eabee42

Contents?: true

Size: 709 Bytes

Versions: 2

Compression:

Stored size: 709 Bytes

Contents

require 'spec_helper'
module Finitio
  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

2 entries across 2 versions & 1 rubygems

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