qunit-rails 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -1
- data/qunit-rails.gemspec +1 -1
- data/vendor/assets/javascripts/qunit.js +161 -101
- data/vendor/assets/stylesheets/qunit.css +1 -1
- metadata +9 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 59a108307b5fc8af1eb7e680fa1a62472018caf7
|
4
|
+
data.tar.gz: c23b8db5646703f3e72327c1a62baf2d6960d113
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ab29f53dedacf6efb20ee9671a6169abebbdf513b31b76a765ea93d8ce1df6710b35cdc8011f36f4c1c252d55bb33c55256811020f221d584d704321b6640c17
|
7
|
+
data.tar.gz: ae022fd3686219d3c41b4d95a858fd1da92e97e2673defdc91bcfbeaec8a5becbd8257972d0092a3d7c140038350b2ae008fbd01dfa68f737e3640bf8f794eaf
|
data/README.md
CHANGED
data/qunit-rails.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
/**
|
2
|
-
* QUnit v1.
|
2
|
+
* QUnit v1.12.0 - A JavaScript Unit Testing Framework
|
3
3
|
*
|
4
4
|
* http://qunitjs.com
|
5
5
|
*
|
6
|
-
* Copyright
|
6
|
+
* Copyright 2013 jQuery Foundation and other contributors
|
7
7
|
* Released under the MIT license.
|
8
|
-
*
|
8
|
+
* https://jquery.org/license/
|
9
9
|
*/
|
10
10
|
|
11
11
|
(function( window ) {
|
@@ -20,6 +20,7 @@ var QUnit,
|
|
20
20
|
hasOwn = Object.prototype.hasOwnProperty,
|
21
21
|
// Keep a local reference to Date (GH-283)
|
22
22
|
Date = window.Date,
|
23
|
+
setTimeout = window.setTimeout,
|
23
24
|
defined = {
|
24
25
|
setTimeout: typeof window.setTimeout !== "undefined",
|
25
26
|
sessionStorage: (function() {
|
@@ -115,8 +116,16 @@ Test.prototype = {
|
|
115
116
|
}
|
116
117
|
},
|
117
118
|
setup: function() {
|
118
|
-
if (
|
119
|
-
|
119
|
+
if (
|
120
|
+
// Emit moduleStart when we're switching from one module to another
|
121
|
+
this.module !== config.previousModule ||
|
122
|
+
// They could be equal (both undefined) but if the previousModule property doesn't
|
123
|
+
// yet exist it means this is the first test in a suite that isn't wrapped in a
|
124
|
+
// module, in which case we'll just emit a moduleStart event for 'undefined'.
|
125
|
+
// Without this, reporters can get testStart before moduleStart which is a problem.
|
126
|
+
!hasOwn.call( config, "previousModule" )
|
127
|
+
) {
|
128
|
+
if ( hasOwn.call( config, "previousModule" ) ) {
|
120
129
|
runLoggingCallbacks( "moduleDone", QUnit, {
|
121
130
|
name: config.previousModule,
|
122
131
|
failed: config.moduleStats.bad,
|
@@ -129,10 +138,6 @@ Test.prototype = {
|
|
129
138
|
runLoggingCallbacks( "moduleStart", QUnit, {
|
130
139
|
name: this.module
|
131
140
|
});
|
132
|
-
} else if ( config.autorun ) {
|
133
|
-
runLoggingCallbacks( "moduleStart", QUnit, {
|
134
|
-
name: this.module
|
135
|
-
});
|
136
141
|
}
|
137
142
|
|
138
143
|
config.current = this;
|
@@ -148,19 +153,27 @@ Test.prototype = {
|
|
148
153
|
module: this.module
|
149
154
|
});
|
150
155
|
|
151
|
-
|
152
|
-
|
156
|
+
/*jshint camelcase:false */
|
157
|
+
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Expose the current test environment.
|
161
|
+
*
|
162
|
+
* @deprecated since 1.12.0: Use QUnit.config.current.testEnvironment instead.
|
163
|
+
*/
|
153
164
|
QUnit.current_testEnvironment = this.testEnvironment;
|
154
165
|
|
166
|
+
/*jshint camelcase:true */
|
167
|
+
|
155
168
|
if ( !config.pollution ) {
|
156
169
|
saveGlobal();
|
157
170
|
}
|
158
171
|
if ( config.notrycatch ) {
|
159
|
-
this.testEnvironment.setup.call( this.testEnvironment );
|
172
|
+
this.testEnvironment.setup.call( this.testEnvironment, QUnit.assert );
|
160
173
|
return;
|
161
174
|
}
|
162
175
|
try {
|
163
|
-
this.testEnvironment.setup.call( this.testEnvironment );
|
176
|
+
this.testEnvironment.setup.call( this.testEnvironment, QUnit.assert );
|
164
177
|
} catch( e ) {
|
165
178
|
QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
|
166
179
|
}
|
@@ -208,11 +221,11 @@ Test.prototype = {
|
|
208
221
|
if ( typeof this.callbackRuntime === "undefined" ) {
|
209
222
|
this.callbackRuntime = +new Date() - this.callbackStarted;
|
210
223
|
}
|
211
|
-
this.testEnvironment.teardown.call( this.testEnvironment );
|
224
|
+
this.testEnvironment.teardown.call( this.testEnvironment, QUnit.assert );
|
212
225
|
return;
|
213
226
|
} else {
|
214
227
|
try {
|
215
|
-
this.testEnvironment.teardown.call( this.testEnvironment );
|
228
|
+
this.testEnvironment.teardown.call( this.testEnvironment, QUnit.assert );
|
216
229
|
} catch( e ) {
|
217
230
|
QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
|
218
231
|
}
|
@@ -419,7 +432,7 @@ QUnit = {
|
|
419
432
|
test.queue();
|
420
433
|
},
|
421
434
|
|
422
|
-
// Specify the number of expected assertions to
|
435
|
+
// Specify the number of expected assertions to guarantee that failed test (no assertions are run at all) don't slip through.
|
423
436
|
expect: function( asserts ) {
|
424
437
|
if (arguments.length === 1) {
|
425
438
|
config.current.expected = asserts;
|
@@ -454,7 +467,7 @@ QUnit = {
|
|
454
467
|
}
|
455
468
|
// A slight delay, to avoid any current callbacks
|
456
469
|
if ( defined.setTimeout ) {
|
457
|
-
|
470
|
+
setTimeout(function() {
|
458
471
|
if ( config.semaphore > 0 ) {
|
459
472
|
return;
|
460
473
|
}
|
@@ -477,7 +490,7 @@ QUnit = {
|
|
477
490
|
|
478
491
|
if ( config.testTimeout && defined.setTimeout ) {
|
479
492
|
clearTimeout( config.timeout );
|
480
|
-
config.timeout =
|
493
|
+
config.timeout = setTimeout(function() {
|
481
494
|
QUnit.ok( false, "Test timed out" );
|
482
495
|
config.semaphore = 1;
|
483
496
|
QUnit.start();
|
@@ -487,7 +500,7 @@ QUnit = {
|
|
487
500
|
};
|
488
501
|
|
489
502
|
// `assert` initialized at top of scope
|
490
|
-
//
|
503
|
+
// Assert helpers
|
491
504
|
// All of these must either call QUnit.push() or manually do:
|
492
505
|
// - runLoggingCallbacks( "log", .. );
|
493
506
|
// - config.current.assertions.push({ .. });
|
@@ -505,6 +518,7 @@ assert = {
|
|
505
518
|
throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) );
|
506
519
|
}
|
507
520
|
result = !!result;
|
521
|
+
msg = msg || (result ? "okay" : "failed" );
|
508
522
|
|
509
523
|
var source,
|
510
524
|
details = {
|
@@ -514,8 +528,7 @@ assert = {
|
|
514
528
|
message: msg
|
515
529
|
};
|
516
530
|
|
517
|
-
msg =
|
518
|
-
msg = "<span class='test-message'>" + msg + "</span>";
|
531
|
+
msg = "<span class='test-message'>" + escapeText( msg ) + "</span>";
|
519
532
|
|
520
533
|
if ( !result ) {
|
521
534
|
source = sourceFromStacktrace( 2 );
|
@@ -642,13 +655,13 @@ assert = {
|
|
642
655
|
|
643
656
|
QUnit.push( ok, actual, expectedOutput, message );
|
644
657
|
} else {
|
645
|
-
QUnit.pushFailure( message, null,
|
658
|
+
QUnit.pushFailure( message, null, "No exception was thrown." );
|
646
659
|
}
|
647
660
|
}
|
648
661
|
};
|
649
662
|
|
650
663
|
/**
|
651
|
-
* @
|
664
|
+
* @deprecated since 1.8.0
|
652
665
|
* Kept assertion helpers in root for backwards compatibility.
|
653
666
|
*/
|
654
667
|
extend( QUnit, assert );
|
@@ -737,7 +750,7 @@ config = {
|
|
737
750
|
// Export global variables, unless an 'exports' object exists,
|
738
751
|
// in that case we assume we're in CommonJS (dealt with on the bottom of the script)
|
739
752
|
if ( typeof exports === "undefined" ) {
|
740
|
-
extend( window, QUnit );
|
753
|
+
extend( window, QUnit.constructor.prototype );
|
741
754
|
|
742
755
|
// Expose QUnit object
|
743
756
|
window.QUnit = QUnit;
|
@@ -836,6 +849,11 @@ extend( QUnit, {
|
|
836
849
|
},
|
837
850
|
|
838
851
|
// Resets the test setup. Useful for tests that modify the DOM.
|
852
|
+
/*
|
853
|
+
DEPRECATED: Use multiple tests instead of resetting inside a test.
|
854
|
+
Use testStart or testDone for custom cleanup.
|
855
|
+
This method will throw an error in 2.0, and will be removed in 2.1
|
856
|
+
*/
|
839
857
|
reset: function() {
|
840
858
|
var fixture = id( "qunit-fixture" );
|
841
859
|
if ( fixture ) {
|
@@ -985,11 +1003,10 @@ extend( QUnit, {
|
|
985
1003
|
querystring = "?";
|
986
1004
|
|
987
1005
|
for ( key in params ) {
|
988
|
-
if (
|
989
|
-
|
1006
|
+
if ( hasOwn.call( params, key ) ) {
|
1007
|
+
querystring += encodeURIComponent( key ) + "=" +
|
1008
|
+
encodeURIComponent( params[ key ] ) + "&";
|
990
1009
|
}
|
991
|
-
querystring += encodeURIComponent( key ) + "=" +
|
992
|
-
encodeURIComponent( params[ key ] ) + "&";
|
993
1010
|
}
|
994
1011
|
return window.location.protocol + "//" + window.location.host +
|
995
1012
|
window.location.pathname + querystring.slice( 0, -1 );
|
@@ -997,7 +1014,10 @@ extend( QUnit, {
|
|
997
1014
|
|
998
1015
|
extend: extend,
|
999
1016
|
id: id,
|
1000
|
-
addEvent: addEvent
|
1017
|
+
addEvent: addEvent,
|
1018
|
+
addClass: addClass,
|
1019
|
+
hasClass: hasClass,
|
1020
|
+
removeClass: removeClass
|
1001
1021
|
// load, equiv, jsDump, diff: Attached later
|
1002
1022
|
});
|
1003
1023
|
|
@@ -1044,6 +1064,7 @@ QUnit.load = function() {
|
|
1044
1064
|
var banner, filter, i, label, len, main, ol, toolbar, userAgent, val,
|
1045
1065
|
urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter,
|
1046
1066
|
numModules = 0,
|
1067
|
+
moduleNames = [],
|
1047
1068
|
moduleFilterHtml = "",
|
1048
1069
|
urlConfigHtml = "",
|
1049
1070
|
oldconfig = extend( {}, config );
|
@@ -1072,18 +1093,24 @@ QUnit.load = function() {
|
|
1072
1093
|
"'><label for='qunit-urlconfig-" + escapeText( val.id ) +
|
1073
1094
|
"' title='" + escapeText( val.tooltip ) + "'>" + val.label + "</label>";
|
1074
1095
|
}
|
1075
|
-
|
1096
|
+
for ( i in config.modules ) {
|
1097
|
+
if ( config.modules.hasOwnProperty( i ) ) {
|
1098
|
+
moduleNames.push(i);
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
numModules = moduleNames.length;
|
1102
|
+
moduleNames.sort( function( a, b ) {
|
1103
|
+
return a.localeCompare( b );
|
1104
|
+
});
|
1076
1105
|
moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' " +
|
1077
1106
|
( config.module === undefined ? "selected='selected'" : "" ) +
|
1078
1107
|
">< All Modules ></option>";
|
1079
1108
|
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
">" + escapeText(i) + "</option>";
|
1086
|
-
}
|
1109
|
+
|
1110
|
+
for ( i = 0; i < numModules; i++) {
|
1111
|
+
moduleFilterHtml += "<option value='" + escapeText( encodeURIComponent(moduleNames[i]) ) + "' " +
|
1112
|
+
( config.module === moduleNames[i] ? "selected='selected'" : "" ) +
|
1113
|
+
">" + escapeText(moduleNames[i]) + "</option>";
|
1087
1114
|
}
|
1088
1115
|
moduleFilterHtml += "</select>";
|
1089
1116
|
|
@@ -1137,7 +1164,7 @@ QUnit.load = function() {
|
|
1137
1164
|
// `label` initialized at top of scope
|
1138
1165
|
label = document.createElement( "label" );
|
1139
1166
|
label.setAttribute( "for", "qunit-filter-pass" );
|
1140
|
-
label.setAttribute( "title", "Only show tests and
|
1167
|
+
label.setAttribute( "title", "Only show tests and assertions that fail. Stored in sessionStorage." );
|
1141
1168
|
label.innerHTML = "Hide passed tests";
|
1142
1169
|
toolbar.appendChild( label );
|
1143
1170
|
|
@@ -1157,14 +1184,19 @@ QUnit.load = function() {
|
|
1157
1184
|
toolbar.appendChild( urlConfigCheckboxesContainer );
|
1158
1185
|
|
1159
1186
|
if (numModules > 1) {
|
1160
|
-
moduleFilter = document.createElement(
|
1161
|
-
moduleFilter.setAttribute(
|
1187
|
+
moduleFilter = document.createElement( "span" );
|
1188
|
+
moduleFilter.setAttribute( "id", "qunit-modulefilter-container" );
|
1162
1189
|
moduleFilter.innerHTML = moduleFilterHtml;
|
1163
1190
|
addEvent( moduleFilter.lastChild, "change", function() {
|
1164
1191
|
var selectBox = moduleFilter.getElementsByTagName("select")[0],
|
1165
1192
|
selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value);
|
1166
1193
|
|
1167
|
-
window.location = QUnit.url(
|
1194
|
+
window.location = QUnit.url({
|
1195
|
+
module: ( selectedModule === "" ) ? undefined : selectedModule,
|
1196
|
+
// Remove any existing filters
|
1197
|
+
filter: undefined,
|
1198
|
+
testNumber: undefined
|
1199
|
+
});
|
1168
1200
|
});
|
1169
1201
|
toolbar.appendChild(moduleFilter);
|
1170
1202
|
}
|
@@ -1188,7 +1220,7 @@ addEvent( window, "load", QUnit.load );
|
|
1188
1220
|
onErrorFnPrev = window.onerror;
|
1189
1221
|
|
1190
1222
|
// Cover uncaught exceptions
|
1191
|
-
// Returning true will
|
1223
|
+
// Returning true will suppress the default browser handler,
|
1192
1224
|
// returning false will let it run.
|
1193
1225
|
window.onerror = function ( error, filePath, linerNr ) {
|
1194
1226
|
var ret = false;
|
@@ -1197,7 +1229,7 @@ window.onerror = function ( error, filePath, linerNr ) {
|
|
1197
1229
|
}
|
1198
1230
|
|
1199
1231
|
// Treat return value as window.onerror itself does,
|
1200
|
-
// Only do our handling if not
|
1232
|
+
// Only do our handling if not suppressed.
|
1201
1233
|
if ( ret !== true ) {
|
1202
1234
|
if ( QUnit.config.current ) {
|
1203
1235
|
if ( QUnit.config.current.ignoreGlobalErrors ) {
|
@@ -1227,6 +1259,7 @@ function done() {
|
|
1227
1259
|
total: config.moduleStats.all
|
1228
1260
|
});
|
1229
1261
|
}
|
1262
|
+
delete config.previousModule;
|
1230
1263
|
|
1231
1264
|
var i, key,
|
1232
1265
|
banner = id( "qunit-banner" ),
|
@@ -1386,16 +1419,16 @@ function escapeText( s ) {
|
|
1386
1419
|
// Both single quotes and double quotes (for attributes)
|
1387
1420
|
return s.replace( /['"<>&]/g, function( s ) {
|
1388
1421
|
switch( s ) {
|
1389
|
-
case '
|
1390
|
-
return
|
1391
|
-
case
|
1392
|
-
return
|
1393
|
-
case
|
1394
|
-
return
|
1395
|
-
case
|
1396
|
-
return
|
1397
|
-
case
|
1398
|
-
return
|
1422
|
+
case "'":
|
1423
|
+
return "'";
|
1424
|
+
case "\"":
|
1425
|
+
return """;
|
1426
|
+
case "<":
|
1427
|
+
return "<";
|
1428
|
+
case ">":
|
1429
|
+
return ">";
|
1430
|
+
case "&":
|
1431
|
+
return "&";
|
1399
1432
|
}
|
1400
1433
|
});
|
1401
1434
|
}
|
@@ -1419,7 +1452,7 @@ function process( last ) {
|
|
1419
1452
|
if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) {
|
1420
1453
|
config.queue.shift()();
|
1421
1454
|
} else {
|
1422
|
-
|
1455
|
+
setTimeout( next, 13 );
|
1423
1456
|
break;
|
1424
1457
|
}
|
1425
1458
|
}
|
@@ -1434,11 +1467,13 @@ function saveGlobal() {
|
|
1434
1467
|
|
1435
1468
|
if ( config.noglobals ) {
|
1436
1469
|
for ( var key in window ) {
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1470
|
+
if ( hasOwn.call( window, key ) ) {
|
1471
|
+
// in Opera sometimes DOM element ids show up here, ignore them
|
1472
|
+
if ( /^qunit-test-output/.test( key ) ) {
|
1473
|
+
continue;
|
1474
|
+
}
|
1475
|
+
config.pollution.push( key );
|
1440
1476
|
}
|
1441
|
-
config.pollution.push( key );
|
1442
1477
|
}
|
1443
1478
|
}
|
1444
1479
|
}
|
@@ -1480,12 +1515,15 @@ function diff( a, b ) {
|
|
1480
1515
|
|
1481
1516
|
function extend( a, b ) {
|
1482
1517
|
for ( var prop in b ) {
|
1483
|
-
if ( b
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1518
|
+
if ( hasOwn.call( b, prop ) ) {
|
1519
|
+
// Avoid "Member not found" error in IE8 caused by messing with window.constructor
|
1520
|
+
if ( !( prop === "constructor" && a === window ) ) {
|
1521
|
+
if ( b[ prop ] === undefined ) {
|
1522
|
+
delete a[ prop ];
|
1523
|
+
} else {
|
1524
|
+
a[ prop ] = b[ prop ];
|
1525
|
+
}
|
1526
|
+
}
|
1489
1527
|
}
|
1490
1528
|
}
|
1491
1529
|
|
@@ -1535,8 +1573,8 @@ function removeClass( elem, name ) {
|
|
1535
1573
|
while ( set.indexOf(" " + name + " ") > -1 ) {
|
1536
1574
|
set = set.replace(" " + name + " " , " ");
|
1537
1575
|
}
|
1538
|
-
// If possible, trim it for prettiness, but not
|
1539
|
-
elem.className =
|
1576
|
+
// If possible, trim it for prettiness, but not necessarily
|
1577
|
+
elem.className = typeof set.trim === "function" ? set.trim() : set.replace(/^\s+|\s+$/g, "");
|
1540
1578
|
}
|
1541
1579
|
|
1542
1580
|
function id( name ) {
|
@@ -1585,8 +1623,10 @@ QUnit.equiv = (function() {
|
|
1585
1623
|
callers = [],
|
1586
1624
|
// stack to avoiding loops from circular referencing
|
1587
1625
|
parents = [],
|
1626
|
+
parentsB = [],
|
1588
1627
|
|
1589
1628
|
getProto = Object.getPrototypeOf || function ( obj ) {
|
1629
|
+
/*jshint camelcase:false */
|
1590
1630
|
return obj.__proto__;
|
1591
1631
|
},
|
1592
1632
|
callbacks = (function () {
|
@@ -1595,7 +1635,7 @@ QUnit.equiv = (function() {
|
|
1595
1635
|
function useStrictEquality( b, a ) {
|
1596
1636
|
/*jshint eqeqeq:false */
|
1597
1637
|
if ( b instanceof a.constructor || a instanceof b.constructor ) {
|
1598
|
-
// to catch short
|
1638
|
+
// to catch short annotation VS 'new' annotation of a
|
1599
1639
|
// declaration
|
1600
1640
|
// e.g. var i = 1;
|
1601
1641
|
// var j = new Number(1);
|
@@ -1624,7 +1664,7 @@ QUnit.equiv = (function() {
|
|
1624
1664
|
return QUnit.objectType( b ) === "regexp" &&
|
1625
1665
|
// the regex itself
|
1626
1666
|
a.source === b.source &&
|
1627
|
-
// and its
|
1667
|
+
// and its modifiers
|
1628
1668
|
a.global === b.global &&
|
1629
1669
|
// (gmi) ...
|
1630
1670
|
a.ignoreCase === b.ignoreCase &&
|
@@ -1641,7 +1681,7 @@ QUnit.equiv = (function() {
|
|
1641
1681
|
},
|
1642
1682
|
|
1643
1683
|
"array": function( b, a ) {
|
1644
|
-
var i, j, len, loop;
|
1684
|
+
var i, j, len, loop, aCircular, bCircular;
|
1645
1685
|
|
1646
1686
|
// b could be an object literal here
|
1647
1687
|
if ( QUnit.objectType( b ) !== "array" ) {
|
@@ -1656,24 +1696,36 @@ QUnit.equiv = (function() {
|
|
1656
1696
|
|
1657
1697
|
// track reference to avoid circular references
|
1658
1698
|
parents.push( a );
|
1699
|
+
parentsB.push( b );
|
1659
1700
|
for ( i = 0; i < len; i++ ) {
|
1660
1701
|
loop = false;
|
1661
1702
|
for ( j = 0; j < parents.length; j++ ) {
|
1662
|
-
|
1663
|
-
|
1703
|
+
aCircular = parents[j] === a[i];
|
1704
|
+
bCircular = parentsB[j] === b[i];
|
1705
|
+
if ( aCircular || bCircular ) {
|
1706
|
+
if ( a[i] === b[i] || aCircular && bCircular ) {
|
1707
|
+
loop = true;
|
1708
|
+
} else {
|
1709
|
+
parents.pop();
|
1710
|
+
parentsB.pop();
|
1711
|
+
return false;
|
1712
|
+
}
|
1664
1713
|
}
|
1665
1714
|
}
|
1666
1715
|
if ( !loop && !innerEquiv(a[i], b[i]) ) {
|
1667
1716
|
parents.pop();
|
1717
|
+
parentsB.pop();
|
1668
1718
|
return false;
|
1669
1719
|
}
|
1670
1720
|
}
|
1671
1721
|
parents.pop();
|
1722
|
+
parentsB.pop();
|
1672
1723
|
return true;
|
1673
1724
|
},
|
1674
1725
|
|
1675
1726
|
"object": function( b, a ) {
|
1676
|
-
|
1727
|
+
/*jshint forin:false */
|
1728
|
+
var i, j, loop, aCircular, bCircular,
|
1677
1729
|
// Default to true
|
1678
1730
|
eq = true,
|
1679
1731
|
aProperties = [],
|
@@ -1692,28 +1744,36 @@ QUnit.equiv = (function() {
|
|
1692
1744
|
|
1693
1745
|
// stack constructor before traversing properties
|
1694
1746
|
callers.push( a.constructor );
|
1747
|
+
|
1695
1748
|
// track reference to avoid circular references
|
1696
1749
|
parents.push( a );
|
1750
|
+
parentsB.push( b );
|
1697
1751
|
|
1698
|
-
|
1699
|
-
|
1752
|
+
// be strict: don't ensure hasOwnProperty and go deep
|
1753
|
+
for ( i in a ) {
|
1700
1754
|
loop = false;
|
1701
1755
|
for ( j = 0; j < parents.length; j++ ) {
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1756
|
+
aCircular = parents[j] === a[i];
|
1757
|
+
bCircular = parentsB[j] === b[i];
|
1758
|
+
if ( aCircular || bCircular ) {
|
1759
|
+
if ( a[i] === b[i] || aCircular && bCircular ) {
|
1760
|
+
loop = true;
|
1761
|
+
} else {
|
1762
|
+
eq = false;
|
1763
|
+
break;
|
1764
|
+
}
|
1705
1765
|
}
|
1706
1766
|
}
|
1707
|
-
aProperties.push(i);
|
1708
|
-
|
1709
|
-
if (!loop && !innerEquiv( a[i], b[i] ) ) {
|
1767
|
+
aProperties.push(i);
|
1768
|
+
if ( !loop && !innerEquiv(a[i], b[i]) ) {
|
1710
1769
|
eq = false;
|
1711
1770
|
break;
|
1712
1771
|
}
|
1713
1772
|
}
|
1714
1773
|
|
1715
|
-
callers.pop(); // unstack, we are done
|
1716
1774
|
parents.pop();
|
1775
|
+
parentsB.pop();
|
1776
|
+
callers.pop(); // unstack, we are done
|
1717
1777
|
|
1718
1778
|
for ( i in b ) {
|
1719
1779
|
bProperties.push( i ); // collect b's properties
|
@@ -1743,7 +1803,7 @@ QUnit.equiv = (function() {
|
|
1743
1803
|
}
|
1744
1804
|
|
1745
1805
|
// apply transition with (1..n) arguments
|
1746
|
-
}( args[0], args[1] ) &&
|
1806
|
+
}( args[0], args[1] ) && innerEquiv.apply( this, args.splice(1, args.length - 1 )) );
|
1747
1807
|
};
|
1748
1808
|
|
1749
1809
|
return innerEquiv;
|
@@ -1761,7 +1821,7 @@ QUnit.equiv = (function() {
|
|
1761
1821
|
*/
|
1762
1822
|
QUnit.jsDump = (function() {
|
1763
1823
|
function quote( str ) {
|
1764
|
-
return
|
1824
|
+
return "\"" + str.toString().replace( /"/g, "\\\"" ) + "\"";
|
1765
1825
|
}
|
1766
1826
|
function literal( o ) {
|
1767
1827
|
return o + "";
|
@@ -1854,13 +1914,13 @@ QUnit.jsDump = (function() {
|
|
1854
1914
|
if ( this.HTML ) {
|
1855
1915
|
chr = chr.replace( /\t/g, " " ).replace( / /g, " " );
|
1856
1916
|
}
|
1857
|
-
return new Array( this.
|
1917
|
+
return new Array( this.depth + ( extra || 0 ) ).join(chr);
|
1858
1918
|
},
|
1859
1919
|
up: function( a ) {
|
1860
|
-
this.
|
1920
|
+
this.depth += a || 1;
|
1861
1921
|
},
|
1862
1922
|
down: function( a ) {
|
1863
|
-
this.
|
1923
|
+
this.depth -= a || 1;
|
1864
1924
|
},
|
1865
1925
|
setParser: function( name, parser ) {
|
1866
1926
|
this.parsers[name] = parser;
|
@@ -1870,7 +1930,7 @@ QUnit.jsDump = (function() {
|
|
1870
1930
|
literal: literal,
|
1871
1931
|
join: join,
|
1872
1932
|
//
|
1873
|
-
|
1933
|
+
depth: 1,
|
1874
1934
|
// This is the list of parsers, to modify them, use jsDump.setParser
|
1875
1935
|
parsers: {
|
1876
1936
|
window: "[Window]",
|
@@ -1898,6 +1958,7 @@ QUnit.jsDump = (function() {
|
|
1898
1958
|
nodelist: array,
|
1899
1959
|
"arguments": array,
|
1900
1960
|
object: function( map, stack ) {
|
1961
|
+
/*jshint forin:false */
|
1901
1962
|
var ret = [ ], keys, key, val, i;
|
1902
1963
|
QUnit.jsDump.up();
|
1903
1964
|
keys = [];
|
@@ -2036,18 +2097,17 @@ QUnit.diff = (function() {
|
|
2036
2097
|
}
|
2037
2098
|
|
2038
2099
|
for ( i in ns ) {
|
2039
|
-
if (
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
};
|
2100
|
+
if ( hasOwn.call( ns, i ) ) {
|
2101
|
+
if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) {
|
2102
|
+
n[ ns[i].rows[0] ] = {
|
2103
|
+
text: n[ ns[i].rows[0] ],
|
2104
|
+
row: os[i].rows[0]
|
2105
|
+
};
|
2106
|
+
o[ os[i].rows[0] ] = {
|
2107
|
+
text: o[ os[i].rows[0] ],
|
2108
|
+
row: ns[i].rows[0]
|
2109
|
+
};
|
2110
|
+
}
|
2051
2111
|
}
|
2052
2112
|
}
|
2053
2113
|
|
@@ -2143,9 +2203,9 @@ QUnit.diff = (function() {
|
|
2143
2203
|
};
|
2144
2204
|
}());
|
2145
2205
|
|
2146
|
-
// for CommonJS
|
2206
|
+
// for CommonJS environments, export everything
|
2147
2207
|
if ( typeof exports !== "undefined" ) {
|
2148
|
-
extend( exports, QUnit );
|
2208
|
+
extend( exports, QUnit.constructor.prototype );
|
2149
2209
|
}
|
2150
2210
|
|
2151
2211
|
// get at whatever the global object is, like window in browsers
|
metadata
CHANGED
@@ -1,30 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qunit-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Francesco Rodriguez
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: railties
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.2.3
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.2.3
|
30
27
|
description: Qunit for Rails 3.2+
|
@@ -59,27 +56,26 @@ files:
|
|
59
56
|
- vendor/assets/stylesheets/qunit.css
|
60
57
|
homepage: https://github.com/frodsan/qunit-rails
|
61
58
|
licenses: []
|
59
|
+
metadata: {}
|
62
60
|
post_install_message:
|
63
61
|
rdoc_options:
|
64
62
|
- --charset=UTF-8
|
65
63
|
require_paths:
|
66
64
|
- lib
|
67
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
66
|
requirements:
|
70
|
-
- -
|
67
|
+
- - '>='
|
71
68
|
- !ruby/object:Gem::Version
|
72
69
|
version: 1.9.2
|
73
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
71
|
requirements:
|
76
|
-
- -
|
72
|
+
- - '>='
|
77
73
|
- !ruby/object:Gem::Version
|
78
74
|
version: '0'
|
79
75
|
requirements: []
|
80
76
|
rubyforge_project:
|
81
|
-
rubygems_version:
|
77
|
+
rubygems_version: 2.0.3
|
82
78
|
signing_key:
|
83
|
-
specification_version:
|
79
|
+
specification_version: 4
|
84
80
|
summary: Qunit for Rails 3.2+
|
85
81
|
test_files: []
|