Sha256: 05f2b8418c3acf65db71ef0af8a097be56f0276de2ed0b2c6a4d3d1fa8a7cc3f

Contents?: true

Size: 1.73 KB

Versions: 2

Compression:

Stored size: 1.73 KB

Contents

require 'spec_helper'

describe "@include span-columns()" do
  let (:identifier) {"span-columns"}

  before(:all) do
    ParserSupport.parse_file(identifier)
  end

  context "with argument '6' in a twelve-column grid" do
    it "sets width in percentage" do
      expect('.span-columns-default').to have_rule('width: 48.82117%')
    end

    it "sets gutter in percentage" do
      expect('.span-columns-default').to have_rule('margin-right: 2.35765%')
    end

    it "sets display to block" do
      expect('.span-columns-default').to have_rule('display: block')
    end

    it "sets float to left" do
      expect('.span-columns-default').to have_rule('float: left')
    end

    it "removes gutter from last element" do
      expect('.span-columns-default:last-child').to have_rule('margin-right: 0')
    end
  end

  context "when nested" do
    it "sets relative width in percentage" do
      expect('.span-columns-default .span-columns-nested').to have_rule('width: 30.11389%')
    end

    it "sets relative gutter in percentage" do
      expect('.span-columns-default .span-columns-nested').to have_rule('margin-right: 4.82916%')
    end
  end

  context "with argument 'table'" do
    it "sets display to table-cell" do
      expect('.span-columns-table').to have_rule('display: table-cell')
    end

    it "sets padding in percentage" do
      expect('.span-columns-table').to have_rule('padding-right: 2.35765%')
    end

    it "substracts gutter from width of last element" do
      expect('.span-columns-table:last-child').to have_rule('width: 48.82117%')
    end
  end

  context "with argument 'inline-block'" do
    it "sets display to inline-block" do
      expect('.span-columns-inline-block').to have_rule('display: inline-block')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
neat-1.2.1 spec/neat/columns_spec.rb
neat-1.2.0 spec/neat/columns_spec.rb