| 1 |
require "spec_helper" |
| 2 |
|
| 3 |
describe "border-style" do |
| 4 |
before(:all) do |
| 5 |
ParserSupport.parse_file("library/border-style") |
| 6 |
end |
| 7 |
|
| 8 |
context "called with one style" do |
| 9 |
it "applies same style to all sides" do |
| 10 |
rule = "border-style: solid" |
| 11 |
|
| 12 |
expect(".border-style-all").to have_rule(rule) |
| 13 |
end |
| 14 |
end |
| 15 |
|
| 16 |
context "called with two styles" do |
| 17 |
it "applies to alternating sides" do |
| 18 |
rule = "border-style: dotted dashed" |
| 19 |
|
| 20 |
expect(".border-style-alternate").to have_rule(rule) |
| 21 |
end |
| 22 |
end |
| 23 |
|
| 24 |
context "called with three styles" do |
| 25 |
it "applies second style to left and right" do |
| 26 |
rule = "border-style: dashed double solid" |
| 27 |
|
| 28 |
expect(".border-style-implied-left").to have_rule(rule) |
| 29 |
end |
| 30 |
end |
| 31 |
|
| 32 |
context "called with four styles" do |
| 33 |
it "applies different styles to all sides" do |
| 34 |
rule = "border-style: dotted groove ridge none" |
| 35 |
|
| 36 |
expect(".border-style-explicit").to have_rule(rule) |
| 37 |
end |
| 38 |
end |
| 39 |
|
| 40 |
context "called with null values" do |
| 41 |
it "writes rules for other three" do |
| 42 |
ruleset = "border-top-style: inset; " + |
| 43 |
"border-right-style: none; " + |
| 44 |
"border-left-style: double;" |
| 45 |
bad_rule = "border-bottom-style: null;" |
| 46 |
|
| 47 |
expect(".border-style-false-third").to have_ruleset(ruleset) |
| 48 |
expect(".border-style-false-third").to_not have_rule(bad_rule) |
| 49 |
end |
| 50 |
end |
| 51 |
end |