Permalink
Browse files

I think I got the race condition figured out.

  • Loading branch information...
1 parent 23c7d96 commit 85a8add1e6834c2e6831c77f7bc8104c3041c14e @btakita btakita committed Apr 30, 2008
Showing with 13 additions and 13 deletions.
  1. +13 −13 lib/screw.builder.js
View
@@ -1,18 +1,18 @@
var Screw = {
Unit: function(suite) {
- if(!Screw.root_element) {
- Screw.root_element = $('<div class="describe">');
- Screw.root_element
- .append($('<h3 class="status">'))
- .append('<ol class="befores">')
- .append('<ul class="its">')
- .append('<ul class="describes">')
- .append('<ol class="afters">')
- Screw.Specifications.context.push(Screw.root_element);
- }
-
Screw.last_suite = suite;
- Screw.root_element.ready(function() {
+ $("html").ready(function() {
+ if(!Screw.root_element) {
+ Screw.root_element = $('<div class="describe">');
+ Screw.root_element
+ .append($('<h3 class="status">'))
+ .append('<ol class="befores">')
+ .append('<ul class="its">')
+ .append('<ul class="describes">')
+ .append('<ol class="afters">')
+ Screw.Specifications.context.push(Screw.root_element);
+ }
+
$(function() {
$('body').append(Screw.root_element);
var contents = suite.toString().match(/^[^\{]*{((.*\n*)*)}/m)[1];
@@ -23,7 +23,7 @@ var Screw = {
if(Screw.last_suite == suite) {
$(Screw).trigger('loaded')
}
- })
+ });
});
},
root_element: null,

0 comments on commit 85a8add

Please sign in to comment.