| 1 |
require "spec_helper" |
| 2 |
|
| 3 |
describe "is-size" do |
| 4 |
before(:all) do |
| 5 |
ParserSupport.parse_file("validators/is-size") |
| 6 |
end |
| 7 |
|
| 8 |
context "called with integer" do |
| 9 |
it "is not a size" do |
| 10 |
expect(".integer").to_not have_rule("margin-top: 1") |
| 11 |
end |
| 12 |
end |
| 13 |
|
| 14 |
context "called with px" do |
| 15 |
it "is a size" do |
| 16 |
expect(".px").to have_rule("margin-top: 2px") |
| 17 |
end |
| 18 |
end |
| 19 |
|
| 20 |
context "called with em" do |
| 21 |
it "is a size" do |
| 22 |
expect(".em").to have_rule("margin-top: 3em") |
| 23 |
end |
| 24 |
end |
| 25 |
|
| 26 |
context "called with rem" do |
| 27 |
it "is a size" do |
| 28 |
expect(".rem").to have_rule("margin-top: 4rem") |
| 29 |
end |
| 30 |
end |
| 31 |
|
| 32 |
context "called with percent" do |
| 33 |
it "is a size" do |
| 34 |
expect(".percent").to have_rule("margin-top: 5%") |
| 35 |
end |
| 36 |
end |
| 37 |
|
| 38 |
context "called with string" do |
| 39 |
it "is not a size" do |
| 40 |
expect(".string").to_not have_rule("margin-top: \"stringy\"") |
| 41 |
end |
| 42 |
end |
| 43 |
end |