Testing Overflow-Wrap Mixin Implementation in Bourbon
This test suite validates the overflow-wrap mixin functionality in Bourbon’s CSS library, ensuring proper CSS property generation for text wrapping behavior. The tests verify both default break-word and normal value implementations across multiple browser compatibility scenarios.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
thoughtbot/bourbon
spec/bourbon/library/overflow_wrap_spec.rb
require "spec_helper"
describe "overflow-wrap" do
before(:all) do
ParserSupport.parse_file("library/overflow-wrap")
end
context "called on element" do
it "adds overflow-wrap and word-wrap" do
input = ".overflow-wrap"
ruleset = "word-wrap: break-word; " +
"overflow-wrap: break-word;"
expect(input).to have_ruleset(ruleset)
end
end
context "called on element with normal" do
it "sets values as normal" do
input = ".overflow-wrap-normal"
ruleset = "word-wrap: normal; " +
"overflow-wrap: normal;"
expect(input).to have_ruleset(ruleset)
end
end
end