diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-05-11 14:12:55 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-05-11 14:12:55 +0200 |
commit | 0448390173ed3feb3795b38496f0c0fb59adeb7b (patch) | |
tree | 43a335b25a4c1c5b00cc16c1ec059758b85d3e53 /test | |
parent | 3a7e65ca638bfcd615dcd24d4ee800596621be8b (diff) | |
download | bitraf-bot-0448390173ed3feb3795b38496f0c0fb59adeb7b.tar.gz bitraf-bot-0448390173ed3feb3795b38496f0c0fb59adeb7b.tar.bz2 bitraf-bot-0448390173ed3feb3795b38496f0c0fb59adeb7b.tar.xz bitraf-bot-0448390173ed3feb3795b38496f0c0fb59adeb7b.zip |
o Adding ,who.
Diffstat (limited to 'test')
-rw-r--r-- | test/who.test.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/who.test.js b/test/who.test.js new file mode 100644 index 0000000..27a8c70 --- /dev/null +++ b/test/who.test.js @@ -0,0 +1,31 @@ +var BitrafBot = require('../lib/BitrafBot.js') + , assert = require('assert'); + +var json = JSON.stringify({ "collection" : + { + "version" : "1.0", + links:[ + {rel: "self", href: "http://hermes.bitraf.no/~trygvis/checkins/checkins.php?from=yesterday&count=0"} + ], + "items" : [ +{ data: [ {"name" : "date", "value" : "2012-05-11T08:55:00+02:00"}, {"name" : "account", "value" : "brokenpoly"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T20:41:35+02:00"}, {"name" : "account", "value" : "Flemm"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T20:29:40+02:00"}, {"name" : "account", "value" : "ccscanf"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T19:57:03+02:00"}, {"name" : "account", "value" : "mortehu"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T19:19:03+02:00"}, {"name" : "account", "value" : "haavares"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T18:53:39+02:00"}, {"name" : "account", "value" : "ccscanf"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T18:36:13+02:00"}, {"name" : "account", "value" : "trygvis"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T15:34:22+02:00"}, {"name" : "account", "value" : "mortehu"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T13:04:14+02:00"}, {"name" : "account", "value" : "brokenpoly"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T13:01:13+02:00"}, {"name" : "account", "value" : "odinho"} ], } +,{ data: [ {"name" : "date", "value" : "2012-05-10T11:10:38+02:00"}, {"name" : "account", "value" : "mortehu"} ], } + ], + "count": 11 } +}); + +describe('Who', function() { + it('can parse who', function() { + var str = BitrafBot.onWhoEnd(json); + assert.equal('Checkins: brokenpoly (08:55), Flemm (20:41), ccscanf (20:29), mortehu (19:57), haavares (19:19), trygvis (18:36), odinho (13:01)', str); + }); +}); |