Skip to content

Instantly share code, notes, and snippets.

@Havvy
Created January 20, 2014 10:00
Show Gist options
  • Select an option

  • Save Havvy/8517665 to your computer and use it in GitHub Desktop.

Select an option

Save Havvy/8517665 to your computer and use it in GitHub Desktop.
let describe = macro {
rule { $name:lit { $body ... } } => {
describe($name, function () {
$body ...
});
}
}
let it = macro {
rule { $name:lit { $body ... } } => {
it($name, function () {
$body ...
});
}
rule { $name:lit ( $done:ident ) { $body ... } } => {
it($name, function ($done) {
$body ...
});
}
}
let beforeEach = macro {
rule { { $body ... } } => {
beforeEach(function () {
$body ...
});
}
rule { ( $done:ident ) { $body ... } } => {
beforeEach(function ($done) {
$body ...
});
}
}
let afterEach = macro {
rule { { $body ... } } => {
afterEach(function () {
$body ...
});
}
rule { ( $done:ident ) { $body ... } } => {
afterEach(function ($done) {
$body ...
});
}
}
let only = macro {
rule { $name:ident ( $body ... ) } => {
ident.only($body ...)
}
}
only it 'does not work' {
body;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment