Skip to content

Instantly share code, notes, and snippets.

@mcdave
Created March 11, 2009 10:11
Show Gist options
  • Save mcdave/77399 to your computer and use it in GitHub Desktop.
Save mcdave/77399 to your computer and use it in GitHub Desktop.
SugarTest()
.describe('A context')
.before(function() {
this.something = 1;
})
.it('runs its setup function', function() {
this.assertEqual(1, this.something);
})
.describe('which is an inner context')
.before(function() {
this.something += 1;
})
.it('runs both setup functions', function() {
this.assertEqual(2, this.something);
})
.end()
.end()
.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment