Created
January 3, 2010 19:47
-
-
Save ydnar/268103 to your computer and use it in GitHub Desktop.
CSSpec, BDD for CSS. Theoretical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CSSpec: Theoretical BDD for CSS based on jQuery. Doesn’t exist yet. */ | |
with(CSSpec) { | |
describe("all layouts", function() { | |
describe("body", function() { | |
it("has a white background", function() { | |
value(this.css("background-color")).should.be.color("#fff") | |
}) | |
it("has black text", function() { | |
value(this.css("color")).should.be.color("black") | |
}) | |
}) | |
}) | |
describe("two-column layout (thin, wide)" function() { | |
before(function() { | |
$("body").removeClass().addClass("tw") | |
}) | |
describe("#alpha", function() { | |
it("is offset 300px pixels from the left", function() { | |
value(this.position().left).should.be("300px") | |
}) | |
}) | |
describe("#beta", function() { | |
it("is top-aligned with #alpha", function() { | |
value(this.offset().top).should.equal($("#alpha").offset().top) | |
}) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment