summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/MochiKit/Test.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/MochiKit/Test.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/MochiKit/Test.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/gamma/js/MochiKit/Test.js b/frontend/gamma/js/MochiKit/Test.js
index 9520ab2..f29670f 100644
--- a/frontend/gamma/js/MochiKit/Test.js
+++ b/frontend/gamma/js/MochiKit/Test.js
@@ -1,59 +1,59 @@
/***
MochiKit.Test 1.5
See <http://mochikit.com/> for documentation, downloads, license, etc.
(c) 2005 Bob Ippolito. All rights Reserved.
***/
-MochiKit.Base._module('Test', '1.5', ['Base']);
+MochiKit.Base.module(MochiKit, 'Test', '1.5', ['Base']);
MochiKit.Test.runTests = function (obj) {
if (typeof(obj) == "string") {
// TODO: Remove this temporary API change advertisement
throw new TypeError("Automatic module import not supported, call runTests() with proper object: " + obj);
}
var suite = new MochiKit.Test.Suite();
suite.run(obj);
};
MochiKit.Test.Suite = function () {
this.testIndex = 0;
MochiKit.Base.bindMethods(this);
};
MochiKit.Test.Suite.prototype = {
run: function (obj) {
try {
obj(this);
} catch (e) {
this.traceback(e);
}
},
traceback: function (e) {
var items = MochiKit.Iter.sorted(MochiKit.Base.items(e));
print("not ok " + this.testIndex + " - Error thrown");
for (var i = 0; i < items.length; i++) {
var kv = items[i];
if (kv[0] == "stack") {
kv[1] = kv[1].split(/\n/)[0];
}
this.print("# " + kv.join(": "));
}
},
print: function (s) {
print(s);
},
is: function (got, expected, /* optional */message) {
var res = 1;
var msg = null;
try {
res = MochiKit.Base.compare(got, expected);
} catch (e) {
msg = "Can not compare " + typeof(got) + ":" + typeof(expected);
}
if (res) {
msg = "Expected value did not compare equal";
}