From 83a5a7bab92174af8cf4f6acb8abeeb656a63cf4 Mon Sep 17 00:00:00 2001 From: Jeff Whitmire & Corey Innis Date: Tue, 18 Nov 2008 17:35:04 -0800 Subject: [PATCH] added div.screw_unit_content to suite.html and selectors to minimize conflicts with application css/js. --- lib/screw.behaviors.js | 18 +++++++++--------- lib/screw.builder.js | 4 ++-- lib/screw.events.js | 8 ++++---- spec/suite.html | 4 +++- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/screw.behaviors.js b/lib/screw.behaviors.js index 2089fee..bf7524b 100644 --- a/lib/screw.behaviors.js +++ b/lib/screw.behaviors.js @@ -1,15 +1,15 @@ (function($) { $(Screw).bind('loaded', function() { - $('.status').fn({ + $('body > div.screw_unit_content .status').fn({ display: function() { $(this).html( - $('.passed').length + $('.failed').length + ' test(s), ' + $('.failed').length + ' failure(s)
' + + $('.screw_unit_content .passed').length + $('.screw_unit_content .failed').length + ' test(s), ' + $('.screw_unit_content .failed').length + ' failure(s)
' + ((new Date() - Screw.suite_start_time)/1000.0).toString() + " seconds elapsed" ); } }); - $('.describe').fn({ + $('body > div.screw_unit_content .describe').fn({ parent: function() { return $(this).parent('.describes').parent('.describe'); }, @@ -35,11 +35,11 @@ } }); - $('body > .describe').fn({ - selector: function() { return 'body > .describe' } + $('body > div.screw_unit_content > .describe').fn({ + selector: function() { return 'body > div.screw_unit_content > .describe' } }); - $('.it').fn({ + $('body > div.screw_unit_content .it').fn({ parent: function() { return $(this).parent('.its').parent('.describe'); }, @@ -73,16 +73,16 @@ } }); - $('.before').fn({ + $('body > div.screw_unit_content .before').fn({ run: function() { $(this).data('screwunit.run')() } }); - $('.after').fn({ + $('body > div.screw_unit_content .after').fn({ run: function() { $(this).data('screwunit.run')() } }); $(Screw).trigger('before'); - var to_run = unescape(location.search.slice(1)) || 'body > .describe > .describes > .describe'; + var to_run = unescape(location.search.slice(1)) || 'body > div.screw_unit_content > .describe > .describes > .describe'; $(to_run) .focus() .eq(0).trigger('scroll').end() diff --git a/lib/screw.builder.js b/lib/screw.builder.js index 6686993..6780bc8 100644 --- a/lib/screw.builder.js +++ b/lib/screw.builder.js @@ -7,7 +7,7 @@ var Screw = (function($) { ); $(Screw).queue(function() { - Screw.Specifications.context.push($('body > .describe')); + Screw.Specifications.context.push($('body > div.screw_unit_content > .describe')); fn.call(this, Screw.Matchers, Screw.Specifications); Screw.Specifications.context.pop(); $(this).dequeue(); @@ -71,7 +71,7 @@ var Screw = (function($) { .append('
    ') .append('