This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
/
columns_spec.rb
61 lines (48 loc) · 1.73 KB
/
columns_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'spec_helper'
describe "@include span-columns()" do
let (:identifier) {"span_columns"}
before(:all) do
ParserSupport.parse_file(identifier)
end
describe "when passed an int argument" 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 "floats element 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
describe "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
describe "when passed display argument (table)" do
it "sets display to table-cell" do
expect('.span-columns-table').to have_rule('display: table-cell')
end
it "uses padding as gutter" do
expect('.span-columns-table').to have_rule('padding-right: 2.35765%')
end
it "adjusts width of last element" do
expect('.span-columns-table:last-child').to have_rule('width: 48.82117%')
end
end
describe "when passed display 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