Sha256: e22cd3be58842dffe369ea08a4efe20d86beab9d7554dde9ecfeb069b59c690a
Contents?: true
Size: 1.14 KB
Versions: 16
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' module Finitio describe Heading, "allow_extra? and allow_extra" do let(:r){ Attribute.new(:r, intType) } def heading(attributes, options = nil) Heading.new(attributes, options) end it 'is false by default' do expect(heading([r])).not_to be_allow_extra expect(heading([r]).allow_extra).to be_nil expect(heading([r]).extra_type).to be_nil end it 'can be set to true' do expect(heading([r], allow_extra: true)).to be_allow_extra expect(heading([r], allow_extra: true).allow_extra).to eq(anyType) expect(heading([r], allow_extra: true).extra_type).to eq(anyType) end it 'can be set to false explicitely' do expect(heading([r], allow_extra: false)).not_to be_allow_extra expect(heading([r]).allow_extra).to be_nil expect(heading([r]).extra_type).to be_nil end it 'can be set to an explicit type' do expect(heading([r], allow_extra: intType)).to be_allow_extra expect(heading([r], allow_extra: intType).allow_extra).to eql(intType) expect(heading([r], allow_extra: intType).extra_type).to eql(intType) end end end
Version data entries
16 entries across 16 versions & 1 rubygems