Skip to content

Commit

Permalink
Changed the server.js so the method is correctly exported and added p…
Browse files Browse the repository at this point in the history
…roper naming to the test
  • Loading branch information
martymc committed May 9, 2012
1 parent 5de8e37 commit e43ba85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server.js
Expand Up @@ -30,13 +30,14 @@ client.addListener('message', function (from, to, message) {

});

function addressedToBot(message)
var addressedToBot = function (message)
{
if (message.substring(0, config.botName.length) == config.botName)
{
return true;
}
}
exports.addressedToBot = addressedToBot;

function getTwitterLink(message)
{
Expand Down
2 changes: 1 addition & 1 deletion test/tests.js
@@ -1,7 +1,7 @@
var assert = require('assert');
var ircParrot = require('../server.js');

describe('addressedToBot', function() {
describe('When the bot is addressed correctly', function() {
it('should return true', function() {
var result = ircParrot.addressedToBot('parrot: ');
assert.equal(result, true);
Expand Down

0 comments on commit e43ba85

Please sign in to comment.