# frozen_string_literal: false
require 'spec_helper'
describe USPSFlags::Core do
before do
@fly = USPSFlags::Config::BASE_FLY
@hoist = USPSFlags::Config::BASE_HOIST
@red = USPSFlags::Config::RED
@blue = USPSFlags::Config::BLUE
end
describe 'trident_spec' do
[
'Field', 'Specification Heading Information', 'Short Trident', 'Delta Trident', 'Circle Trident', 'Long Trident'
].each do |section|
it "contains the #{section} section" do
expect(described_class.trident_spec).to include("")
end
end
end
describe 'headers' do
['?xml ', '!DOCTYPE', 'svg ', 'metadata'].each do |tag|
it "contains the #{tag} tag" do
expect(described_class.headers).to include("<#{tag}")
end
end
end
describe 'footer' do
it 'contains the closing tag' do
expect(described_class.footer).to include('')
end
end
describe 'field' do
it 'correctlies generate the basic field' do
expect(described_class.field).to eql(
<<~SVG
SVG
)
end
it 'correctlies generate the red field' do
expect(described_class.field(color: :red)).to eql(
<<~SVG
SVG
)
end
it 'correctlies generate the swallowtail field' do
expect(described_class.field(style: :swallowtail)).to eql(
<<~SVG
SVG
)
end
it 'correctlies generate the blue past field' do
expect(described_class.field(style: :past, color: :blue)).to eql(
<<~SVG
SVG
)
end
end
describe 'trident' do
it 'correctlies generate a short trident' do
expect(described_class.trident(:s)).to include("')
end
end
describe 'lighthouse' do
it 'correctlies generate a lighthouse' do
expect(described_class.lighthouse).to include('')
end
end
end