Sha256: 3fa0d4256c63a8fbe5499a824f360b0621397404231eb226cc88001377ec459b
Contents?: true
Size: 1.35 KB
Versions: 16
Compression:
Stored size: 1.35 KB
Contents
require 'spec_helper' module Finitio describe Heading, "to_name" do let(:red) { Attribute.new(:red, intType) } let(:blue) { Attribute.new(:blue, intType) } let(:maybe_blue){ Attribute.new(:blue, intType, false) } let(:heading){ Heading.new(attributes) } subject{ heading.to_name } context 'with no attribute' do let(:attributes){ [ ] } it{ should eq('') } end context 'with one attribute' do let(:attributes){ [ red ] } it{ should eq('red: intType') } end context 'with multiple attributes' do let(:attributes){ [ red, blue ] } it{ should eq('red: intType, blue: intType') } end context 'with some optional attributes' do let(:attributes){ [ red, maybe_blue ] } it{ should eq('red: intType, blue :? intType') } end context 'when allowing extra' do let(:heading){ Heading.new([red], allow_extra: true) } it{ should eq('red: intType, ...') } end context 'when allowing extra to a type' do let(:heading){ Heading.new([red], allow_extra: intType) } it{ should eq('red: intType, ...: intType') } end context 'when allowing extra only' do let(:heading){ Heading.new([], allow_extra: true) } it{ should eq('...') } end end end
Version data entries
16 entries across 16 versions & 1 rubygems