Testing Clearfix Mixin Implementation in Bourbon
This test suite validates the clearfix mixin functionality in the Bourbon library, ensuring proper CSS clearing behavior. The tests verify the generation of appropriate CSS rules for clearing floated elements using the ::after pseudo-element approach.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
thoughtbot/bourbon
spec/bourbon/library/clearfix_spec.rb
require "spec_helper"
describe "clearfix" do
before(:all) do
ParserSupport.parse_file("library/clearfix")
end
context "called on element" do
it "adds clearfix" do
input = ".clearfix::after"
ruleset = "clear: both; " +
'content: ""; ' +
"display: block;"
expect(input).to have_ruleset(ruleset)
end
end
end