assets/vendor/screw-unit/lib/screw.behaviors.js in screw_server-0.1.7 vs assets/vendor/screw-unit/lib/screw.behaviors.js in screw_server-0.1.8
- old
+ new
@@ -11,41 +11,41 @@
$('.describe').fn({
parent: function() {
return $(this).parent('.describes').parent('.describe');
},
-
+
run_befores: function() {
$(this).fn('parent').fn('run_befores');
$(this).children('.befores').children('.before').fn('run');
},
-
+
run_afters: function() {
$(this).fn('parent').fn('run_afters');
$(this).children('.afters').children('.after').fn('run');
},
-
+
enqueue: function() {
$(this).children('.its').children('.it').fn('enqueue');
$(this).children('.describes').children('.describe').fn('enqueue');
},
-
+
selector: function() {
return $(this).fn('parent').fn('selector')
+ ' > .describes > .describe:eq(' + $(this).parent('.describes').children('.describe').index(this) + ')';
}
});
-
+
$('body > .describe').fn({
selector: function() { return 'body > .describe' }
});
-
+
$('.it').fn({
parent: function() {
return $(this).parent('.its').parent('.describe');
},
-
+
run: function() {
var exception_during_spec;
try {
try {
$(this).fn('parent').fn('run_befores');
@@ -64,29 +64,29 @@
// (because the one thrown afterwards is likely to be a subsequent error)
var exception_to_report = exception_during_spec || any_exception;
$(this).trigger('failed', [exception_to_report]);
}
},
-
+
enqueue: function() {
var self = $(this).trigger('enqueued');
$(Screw)
.queue(function() {
self.fn('run');
setTimeout(function() { $(Screw).dequeue() }, 0);
});
},
-
+
selector: function() {
return $(this).fn('parent').fn('selector')
+ ' > .its > .it:eq(' + $(this).parent('.its').children('.it').index(this) + ')';
}
});
-
+
$('.before').fn({
run: function() { $(this).data('screwunit.run')() }
- });
-
+ });
+
$('.after').fn({
run: function() { $(this).data('screwunit.run')() }
});
$(Screw).trigger('before');