Permalink
Browse files

Describes are defined within a root div.

  • Loading branch information...
1 parent 8107f15 commit 30e613d9aabac3da4f11785eecd181adf972f245 @btakita btakita committed Apr 28, 2008
Showing with 7 additions and 5 deletions.
  1. +2 −2 lib/screw.behaviors.js
  2. +5 −3 lib/screw.builder.js
View
@@ -32,7 +32,7 @@ $(Screw).bind('loaded', function() {
if(parent_selector) {
return parent_selector + ' > .describes > .describe:eq(' + $(this).parent('.describes').children('.describe').index(this) + ')';
} else {
- return 'body';
+ return 'body > .describe';
}
}
});
@@ -78,7 +78,7 @@ $(Screw).bind('loaded', function() {
});
$('.status').text('Running...');
- var to_run = unescape(location.search.slice(1)) || 'body > .describes > .describe';
+ var to_run = unescape(location.search.slice(1)) || 'body > .describe > .describes > .describe';
$(to_run)
.focus()
.fn('enqueue');
View
@@ -7,15 +7,15 @@ var Screw = {
if(!Screw.global_suite_added) {
$(function() {
- var body = $('body');
- body
+ Screw.root_element = $('<div class="describe">');
+ Screw.root_element
.addClass('describe')
.append($('<h3 class="status">'))
.append('<ol class="befores">')
.append('<ul class="its">')
.append('<ul class="describes">')
.append('<ol class="afters">')
- Screw.Specifications.context.push(body);
+ Screw.Specifications.context.push(Screw.root_element);
})
Screw.global_suite_added = true
}
@@ -24,11 +24,13 @@ var Screw = {
$(function() {
suite.call(this, Screw.Matchers, Screw.Specifications);
if(Screw.last_suite == suite) {
+ $('body').append(Screw.root_element);
$(Screw).trigger('loaded')
}
})
},
global_suite_added: false,
+ root_element: null,
last_suite: null,
Specifications: {
context: [],

0 comments on commit 30e613d

Please sign in to comment.