Skip to content

Instantly share code, notes, and snippets.

@ydnar
Created January 3, 2010 19:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ydnar/268103 to your computer and use it in GitHub Desktop.
Save ydnar/268103 to your computer and use it in GitHub Desktop.
CSSpec, BDD for CSS. Theoretical.
/* 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