require 'spec_helper' RSpec.describe "Container" do it "creates a container table" do input = '' expected = <<-HTML
HTML compare(input, expected) end it 'works when parsing a full HTML document' do input = <<-INKY INKY expected = <<-HTML
HTML compare(input, expected) end end RSpec.describe 'Grid' do it 'creates a row' do input = '' expected = <<-HTML
HTML compare(input, expected) end it 'creates a single column with default large and small classes' do input = 'One' expected = <<-HTML
One
HTML compare(input, expected) end it 'creates a single column with default large and small classes using the column_count option' do begin @previous_column_count = Inky.configuration.column_count Inky.configure do |config| config.column_count = 5 end input = 'One' expected = <<-HTML
One
HTML compare(input, expected) ensure Inky.configure do |config| config.column_count = @previous_column_count end end end it 'creates a single column with first and last classes' do input = 'One' expected = <<-HTML
One
HTML compare(input, expected) end it 'creates two columns, one first, one last' do input = <<-INKY One Two INKY expected = <<-HTML
One
Two
HTML compare(input, expected) end it 'creates 3+ columns, first is first, last is last' do input = <<-INKY One Two Three INKY expected = <<-INKY
One
Two
Three
INKY compare(input, expected) end it 'transfers classes to the final HTML' do input = 'One' expected = <<-HTML
One
HTML compare(input, expected) end # if it just has small, borrow from small for large it 'automatically assigns large columns if no large attribute is assigned' do input = <<-HTML One Two HTML expected = <<-INKY
One
Two
INKY compare(input, expected) end it 'automatically assigns small columns as full width if only large defined' do input = <<-INKY One Two INKY expected = <<-HTML
One
Two
HTML compare(input, expected) end it 'assigns small as full width and large as half width if neither is defined and there are two columns' do input = <<-INKY One Two INKY expected = <<-HTML
One
Two
HTML compare(input, expected) end it 'supports nested grids' do input = '' expected = <<-HTML
HTML compare(input, expected) end it 'transfers attributes like valign' do input = 'x' expected = <<-HTML
x
HTML compare(input, expected) end end RSpec.describe 'Block Grid' do it 'returns the correct block grid syntax' do input = '' expected = <<-HTML
HTML compare(input, expected) end it 'copies classes to the final HTML output' do input = '' expected = <<-HTML
HTML compare(input, expected) end end