driver cleanups

This commit is contained in:
Geoff Schmidt
2012-01-18 21:43:54 -08:00
parent 3e1fbe0577
commit 32410dbb36
3 changed files with 16 additions and 17 deletions

View File

@@ -54,12 +54,17 @@ Sky._def_template = function (name, raw_func) {
var in_partial = !!Sky._pending_partials;
if (!in_partial)
Sky._pending_partials = {};
// XXX should catch exceptions and clean up pending_partials if
// stack is unwound
var html = raw_func(data, {
helpers: name ? Template[name] : {},
partials: Sky._partials
});
// try { XXX NOCOMMIT COMMENT???
var html = raw_func(data, {
helpers: name ? Template[name] : {},
partials: Sky._partials
});
/* } catch (e) {
if (!in_partial)
Sky._pending_partials = null;
throw e;
} */
// XXX see the 'clean' function in jquery for a much more
// elaborate implementation of this. it's smart about

View File

@@ -3,13 +3,11 @@
</head>
<body>
placeholder
{{> results }}
placeholder
</body>
<template name="results">
placeholder
{{> rerun_all_button }}
{{#each results}}
{{#if type_is "begin"}}
<div class="begin">{{name}}</div>
@@ -25,27 +23,20 @@
{{/if}}
{{/if}}
{{/each}}
{{> rerun_all_button }}
placeholder
</template>
<template name="rerun_all_button">
placeholder
<div><div class="rerunall">Rerun all</div></div>
placeholder
</template>
<template name="exception">
placeholder
<div class="exception">Exception: {{message}}
{{stack}}
<div class="rerun">Rerun and stop here</div>
</div>
placeholder
</template>
<template name="fail">
placeholder
{{#if type_is "assert"}}
<div class="assert">
{{message}}
@@ -59,7 +50,6 @@
<span>
<div class="rerun">Rerun and stop here</a>
</span>
placeholder
</template>
<template name="test_renderList_each">

View File

@@ -20,6 +20,10 @@ Template.exception.events = {
}
};
Template.fail.type_is = function (arg) {
return this.type === arg;
};
Template.fail.events = {
"click .rerun": function () {
run_tests(this.cookie);