namespace.html revision 0771d781138a507b3e657573703f511291640bf3
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews<p><input type="button" value="Run Tests" id="btnRun" disabled="true" /></p>
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews<script type="text/javascript" src="/build/yui/yui.js"></script>
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews(function() {
d0eb2cc33c5db3366a16b1cb0abcca6ec7c8ee3cTatuya JINMEI 神明達哉 filter: "debug",
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews useConsole: true,
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews logExclude: {Dom: true, Selector: true, Node: true, attribute: true, base: true, event: true, widget: true}
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews }).use("dump", "test", "console", "event-custom", function(Y) {
63ca494e7e9aba8dc6740443fdab69620c7a7523Brian Wellington var button = Y.get('#btnRun'),
9e53cbca72767d0c91962b7a01650ea07d7398ddMark Andrews // Set up the page
63ca494e7e9aba8dc6740443fdab69620c7a7523Brian Wellington button.set("disabled", false);
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews Y.on("click", function() {
440be4c866f6935ac069db79a414304507a664c2Michael Graff // var myConsole = new Y.Console().render();
d0eb2cc33c5db3366a16b1cb0abcca6ec7c8ee3cTatuya JINMEI 神明達哉 var testNamespace = new Y.Test.Case({
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson name: "Namespace tests",
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews test_create_namespace: function () {
9ec46fafd60c5450352597547dd62a87f330664bMark Andrews // use the returned reference, assign a value
686b27bfd3ef906721fad485e3dae759679890b7Mark Andrews ns.test = "yahoo_my_namespace_test";
f7d85bae58428b91fde90f87c1e9ef89897acf2eAndreas Gustafsson // check for the assigned value using the full path
39073e9734e5e0ebb88ab9e3b14a85b7a0b9578bMark Andrews Assert.areEqual(Y.my.namespace.test, "yahoo_my_namespace_test", "The namespace was not set up correctly");
39073e9734e5e0ebb88ab9e3b14a85b7a0b9578bMark Andrews // assign a value to my to test that it doesn't get wiped out
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence Y.my.test = "yahoo_my_test";
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews // create another namespace on my
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence // make sure my stays the same
ce1f5b8d0ae5936fd187c1f414ff12a7e3b0aa37Andreas Gustafsson Assert.areEqual(Y.my.test, "yahoo_my_test", "The namespace was obliterated");