@@ -23,6 +23,7 @@ FuncUnit.
23
23
* but before any more queued actions.
24
24
*/
25
25
wait = function ( time , success ) {
26
+ assignQunit2Assert ( FuncUnit . wait ) ;
26
27
if ( typeof time == 'function' ) {
27
28
success = time ;
28
29
time = undefined ;
@@ -68,6 +69,7 @@ FuncUnit.
68
69
* @param {Number } timeout if neither checker returns true before this timeout, the test fails
69
70
*/
70
71
branch = function ( check1 , success1 , check2 , success2 , timeout ) {
72
+ assignQunit2Assert ( FuncUnit . branch ) ;
71
73
FuncUnit . repeat ( {
72
74
method : function ( print ) {
73
75
print ( "Running a branch statement" )
@@ -99,7 +101,7 @@ branch = function(check1, success1, check2, success2, timeout){
99
101
bind: this
100
102
*/
101
103
FuncUnit . repeat = function ( options ) {
102
-
104
+ assignQunit2Assert ( FuncUnit . repeat ) ;
103
105
var interval ,
104
106
stopped = false ,
105
107
stop = function ( ) {
@@ -155,13 +157,22 @@ FuncUnit.repeat = function(options){
155
157
* if the tested page has jQuery present.
156
158
*/
157
159
FuncUnit . animationEnd = function ( ) {
160
+ assignQunit2Assert ( FuncUnit . animationEnd ) ;
158
161
F ( "body" ) . wait ( 200 ) . size ( function ( ) {
159
162
return F . win . $ ( ':animated' ) . length === 0 ;
160
163
} ) ;
161
164
} ;
162
165
163
166
FuncUnit . animationsDone = FuncUnit . animationEnd ;
164
167
168
+ var assignQunit2Assert = function ( func ) {
169
+ var callerFirstArgument = func . caller . arguments [ 0 ] ;
170
+
171
+ if ( callerFirstArgument && callerFirstArgument . test ) {
172
+ FuncUnit . qunit2Assert = callerFirstArgument ;
173
+ }
174
+ } ;
175
+
165
176
$ . extend ( FuncUnit . prototype , {
166
177
/**
167
178
* @function FuncUnit.prototype.exists .exists()
0 commit comments