-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
exports.suffixes = [ | ||
'the Red', | ||
'the Sour', | ||
'the Strong', | ||
'the Grumpy', | ||
'the Stout' | ||
] | ||
|
||
exports.prefixes = [ | ||
"Lil'", | ||
'Peg-legged', | ||
'Two-Legged', | ||
'One-Eyed', | ||
'Two-Eyed', | ||
'Four-Eyed', | ||
'Smelly' | ||
] | ||
|
||
exports.command = 'name' | ||
exports.describe = "what's yer pirate name?" | ||
exports.builder = {} | ||
exports.handler = function (argv) { | ||
const prefix = exports.prefixes[parseInt(Math.random() * exports.prefixes.length)] | ||
const suffix = exports.suffixes[parseInt(Math.random() * exports.suffixes.length)] | ||
argv.respond(`${argv.user_name} your pirate name is, "${prefix} ${argv.user_name} ${suffix}"`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* global describe, it */ | ||
|
||
const name = require('../../commands/name') | ||
|
||
require('chai').should() | ||
|
||
describe('Name Command', () => { | ||
it('generates a random pirate name', (done) => { | ||
name.handler({ | ||
user_name: 'bcoe', | ||
respond: (msg) => { | ||
msg.should.match(/bcoe your pirate name is/) | ||
return done() | ||
} | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters