fanyi-n
Version:
A translate tool in your command line
20 lines (17 loc) • 693 B
JavaScript
var coffee = require('coffee');
var path = require('path');
var version = require('../package').version;
describe('fanyi-n', function() {
it('should show help info', function(done) {
coffee.fork(path.join(__dirname, '../bin/fanyi-n'))
.expect('stdout', 'fanyi-n ~ ' + version + '\nTranslate tools in command line\n $ fanyi-n word\n $ fanyi-n world peace\n $ fanyi-n chinglish\n')
.expect('code', 0)
.end(done);
});
it('should translate word', function(done) {
coffee.fork(path.join(__dirname, '../bin/fanyi-n'), ['word'])
.expect('stdout', /word 英\[ wɜ:d \] 美\[ wɜrd \] ~ iciba\.com/gi)
.expect('code', 0)
.end(done);
});
});