diff -r 000000000000 -r 40c8f766c9b8 src/cm/media/js/lib/yui/yui3.0.0/api/TestSuite.js.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui3.0.0/api/TestSuite.js.html Mon Nov 23 15:14:29 2009 +0100 @@ -0,0 +1,238 @@ + + +
+ +
+ Y.namespace("Test");
+
+ /**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ * a name property as well as setUp and tearDown methods.
+ * @namespace Test
+ * @class Suite
+ * @constructor
+ */
+ Y.Test.Suite = function (data /*:String||Object*/) {
+
+ /**
+ * The name of the test suite.
+ * @type String
+ * @property name
+ */
+ this.name = "";
+
+ /**
+ * Array of test suites and
+ * @private
+ */
+ this.items = [];
+
+ //initialize the properties
+ if (Y.Lang.isString(data)){
+ this.name = data;
+ } else if (Y.Lang.isObject(data)){
+ Y.mix(this, data, true);
+ }
+
+ //double-check name
+ if (this.name === ""){
+ this.name = "testSuite" + Y.guid();
+ }
+
+ };
+
+ Y.Test.Suite.prototype = {
+
+ /**
+ * Adds a test suite or test case to the test suite.
+ * @param {Y.Test.Suite||Y.Test.Case} testObject The test suite or test case to add.
+ * @return {Void}
+ * @method add
+ */
+ add : function (testObject /*:Y.Test.Suite*/) {
+ if (testObject instanceof Y.Test.Suite || testObject instanceof Y.Test.Case) {
+ this.items.push(testObject);
+ }
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+ // Stub Methods
+ //-------------------------------------------------------------------------
+
+ /**
+ * Function to run before each test is executed.
+ * @return {Void}
+ * @method setUp
+ */
+ setUp : function () {
+ },
+
+ /**
+ * Function to run after each test is executed.
+ * @return {Void}
+ * @method tearDown
+ */
+ tearDown: function () {
+ }
+
+ };
+