require 'spec_helper' RSpec.describe "Center" do it "applies a text-center class and center alignment attribute to the first child" do input = '
' expected = <<-HTML
HTML compare(input, expected) end it "doesn't choke if center tags are nested" do input = '
a
' expected = <<-HTML
a
HTML compare(input, expected) end it "applies the class float-center to elements" do input = '
' expected = <<-HTML
HTML compare(input, expected) end end RSpec.describe "Button" do it "creates a simple button" do input = '' expected = <<-HTML
Button
HTML compare(input, expected) end it 'creates a button with target="_blank" attribute' do input = '' expected = <<-HTML
Button
HTML compare(input, expected) end it 'creates a button with classes' do input = '' expected = <<-HTML
Button
HTML compare(input, expected) end it 'creates a correct expanded button' do input = '' expected = <<-HTML
Button
HTML compare(input, expected) end end RSpec.describe "Menu" do it 'creates a menu with item tags inside' do input = <<-INKY Item INKY expected = <<-HTML HTML compare(input, expected) end it 'creates a menu with items tags inside, containing target="_blank" attribute' do input = <<-INKY Item INKY expected = <<-HTML HTML compare(input, expected) end it 'creates a menu with classes' do input = <<-INKY INKY expected = <<-HTML HTML compare(input, expected) end it 'works without using an item tag' do input = <<-INKY Item 1 INKY expected = <<-HTML HTML compare(input, expected) end end RSpec.describe "Callout" do it "creates a callout with correct syntax" do input = 'Callout' expected = <<-HTML
Callout
HTML compare(input, expected) end it "copies classes to the final HTML" do input = 'Callout' expected = <<-HTML
Callout
HTML compare(input, expected) end end RSpec.describe "Spacer" do it 'creates a spacer element with correct size' do input = '' expected = <<-HTML
 
HTML compare(input, expected) end it 'creates a spacer element for small screens with correct size' do input = '' expected = <<-HTML
 
HTML compare(input, expected) end it 'creates a spacer element for large screens with correct size' do input = '' expected = <<-HTML
 
HTML compare(input, expected) end it 'creates a spacer element for small and large screens with correct sizes' do input = '' expected = <<-HTML
 
 
HTML compare(input, expected) end it 'copies classes to the final spacer HTML' do input = '' expected = <<-HTML
 
HTML compare(input, expected) end end RSpec.describe "Wrapper" do it 'creates a wrapper that you can attach classes to' do input = '' expected = <<-HTML
HTML compare(input, expected) end end RSpec.describe "raw" do it 'creates a wrapper that ignores anything inside' do input = "<>" expected = "<>" # Can't do vanilla compare because the second will fail to parse inky = Inky::Core.new output = inky.release_the_kraken(input) expect(output).to eql(expected) end end