| 1 |
require "spec_helper" |
| 2 |
|
| 3 |
describe "unpack" do |
| 4 |
before(:all) do |
| 5 |
ParserSupport.parse_file("utilities/unpack") |
| 6 |
end |
| 7 |
|
| 8 |
context "single" do |
| 9 |
it "unpacks four identical measurements" do |
| 10 |
expect(".single").to have_rule("padding: 10px 10px 10px 10px") |
| 11 |
end |
| 12 |
end |
| 13 |
|
| 14 |
context "double" do |
| 15 |
it "unpacks identical measurements for top and bottom, |
| 16 |
and different identical measurements for left and right" do |
| 17 |
expect(".double").to have_rule("padding: 1em 2em 1em 2em") |
| 18 |
end |
| 19 |
end |
| 20 |
|
| 21 |
context "triple" do |
| 22 |
it "unpacks identical measurements for left and right" do |
| 23 |
expect(".triple").to have_rule("padding: 10px 20px 0 20px") |
| 24 |
end |
| 25 |
end |
| 26 |
|
| 27 |
context "quadruple" do |
| 28 |
it "unpacks four distict measurements" do |
| 29 |
expect(".quadruple").to have_rule("padding: 0 calc(1em + 10px) 20px 50px") |
| 30 |
end |
| 31 |
end |
| 32 |
end |