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