jShoulda TextMate Bundle
Three simple snippets to write jShoulda tests on TextMate
-
con<tab>
generates a root context -
co<tab>
generates an inner context -
sh<tab>
generates ashould
call -
ali<tab>
writes thesetWhateverAlias
call for you -
jst<tab>
inserts- the
script
tags needed to use jShoulda (referencing both jsunittest.js and jshoulda.js) - or the
div#id=testlog
needed by the JsUnitTest logger
- the
-
jsh<tab>
for when you need to write jShoulda without mistakes -
uni<tab>
makes a call tounifyRunners
.
Using describe/it (or any other alias) instead of context/should
Set TextMate configuration variables as needed (Textmate -> Preferences -> Advanced -> Shell Variables):
-
TM_JSHOULDA_CONTEXT
to the word used to create contexts (usually "context" or "describe") -
TM_JSHOULDA_SHOULD
to the word used to create testcases (usually "should" or "it")
Customize the triggers if you think you'll feel more comfortable. By default the bundles uses "context" and "should" with triggers "con", "co" and "sh".
A better experience
Combine with the JavaScript Unit Testing TextMate bundle to obtain complete happiness.
Is it fast?
Watch this 30 seconds screencast. Say wow.