forked from yeoman/generator
-
Notifications
You must be signed in to change notification settings - Fork 0
test fetch
Mickael Daniel edited this page Jan 30, 2013
·
2 revisions
generator.install(name).
this.dummy.install('backbone', function(err) {
fs.stat('components/backbone', done);
});
should allow the fething of a single file.
this.dummy.fetch('https://raw.github.com/yeoman/generators/master/README.md', './some/path/README.md', function (err) {
if (err) {
return done(err);
}
fs.stat('./some/path/README.md', done);
});
should remotely fetch a package on github.
this.dummy.remote('yeoman', 'generators', done);
should have the result cached internally into a _cache
folder.
fs.stat(path.join(this.homedir, '.yeoman/cache/yeoman/generators/master'), done);
should invoke cb
with a remote object to interract with the downloaded package.
this.dummy.remote('yeoman', 'generators', function (err, remote) {
if (err) {
return done(err);
}
['copy', 'template', 'directory'].forEach(function (method) {
assert.equal(typeof remote[method], 'function');
});
done();
});