oojspec example with test runner
https://github.com/rosenfeld/oojspec
by rosenfeld
HTML
<!doctype html>
<html>
<head>
<base href="http://oojspec.herokuapp.com/" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>oojspec Test Runner</title>
<link href="/assets/oojspec.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/oojspec.js" type="text/javascript"></script>
<script type="text/javascript">oojspec.exposeAll()</script>
<!--
<script src="/assets/first_spec.js" type="text/javascript"></script>
<script src="/assets/second_spec.js" type="text/javascript"></script>
-->
</head>
<body>
<script type="text/javascript">
setTimeout(function(){ oojspec.autorun(); }, 1000);
// oojspec.autorun() - doesn't play very well with jsfiddle...
</script>
</body>
</html>
JavaScript
describe('Some description', function(s){
s.example('async examples work', function(s) {
var a = false;
setTimeout(function(){ a = true; }, 200);
s.waitsFor(function(){ return a; });
s.runs(function(){ s.assert(true); });
});
});