Skip to content

Commit

Permalink
Example & Test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Nov 17, 2010
1 parent c4925c2 commit b963de3
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/external-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ YUI.add('external-foo', function(Y) {

Y.log('EXTERNAL FOO LOADED');

});
}, '1.0.0', { requires: ['node'] });
24 changes: 24 additions & 0 deletions examples/module-dyn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node

var sys = require('sys');
var YUI = require("yui3").YUI;
require("assert").equal( global.YUI, undefined, "global yui created");


YUI.add('foo', function(Y) {
Y.log('FOO LOADED');
}, '1.0', { requires: ['external-foo'] });

YUI({
filter: 'debug',
debug: true,
modules: {
'external-foo': {
fullpath: __dirname + '/external-module.js'
}
}
}).use('base', 'foo', function(Y) {

Y.log('This is a test of loading internal and external custom YUI3 modules');

});
29 changes: 29 additions & 0 deletions examples/module-groups.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env node

var sys = require('sys');
var YUI = require("yui3").YUI;
require("assert").equal( global.YUI, undefined, "global yui created");


YUI.add('foo', function(Y) {
Y.log('FOO LOADED');
}, '1.0', { requires: ['external-foo'] });

YUI({
filter: 'debug',
debug: true,
groups: {
dav: {
modules: {
'external-foo': {
fullpath: __dirname + '/external-module.js',
requires: ['dom']
}
}
}
}
}).use('base', 'foo', function(Y) {

Y.log('This is a test of loading internal and external custom YUI3 modules');

});
8 changes: 5 additions & 3 deletions tests/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,14 @@ var window = Y.config.win;

node.setContent('<em>foo</em><span>bar</span>');

//console.log(node._node.outerHTML);
node.insert('<strong>baz</strong>', node.one('span'));
Assert.areEqual(node._node.childNodes[1].tagName, 'STRONG',
"node.insert('<strong>bar</strong>', node.one('span')");
console.log(node._node.outerHTML);
Assert.areEqual('STRONG', node._node.childNodes[1].tagName,
"node.insert('<strong>baz</strong>', node.one('span')");

node.insert('<code>var lorem</code>', node.one('em')._node);
Assert.areEqual(node._node.childNodes[0].tagName, 'CODE',
Assert.areEqual('CODE', node._node.childNodes[0].tagName,
"node.insert('<code>var lorem</code>', node.one('em')._node)");

// insert Node instance
Expand Down

0 comments on commit b963de3

Please sign in to comment.