{"action":"created","comment":{"url":"https://api.github.com/repos/afeld/hubot/pulls/comments/24371241","id":24371241,"diff_hunk":"@@ -0,0 +1,41 @@\n+# Assertions and Stubbing\n+chai = require 'chai'\n+sinon = require 'sinon'\n+chai.use require 'sinon-chai'\n+\n+{ expect } = chai\n+\n+# Hubot classes\n+Robot = require '../src/robot.coffee'\n+{ CatchAllMessage, EnterMessage, Message, TextMessage } = require '../src/message'\n+\n+describe 'Message', ->\n+  beforeEach ->\n+    @robot = new Robot null, 'mock-adapter', yes, 'TestHubot'\n+    @robot.run\n+\n+    @user = @robot.brain.userForId '1', {\n+      name: 'hubottester'\n+      room: '#mocha'\n+    }\n+\n+  afterEach ->\n+   @robot.server.close()\n+   @robot.shutdown()\n+\n+  describe 'Unit Tests', ->\n+    describe '#finish', ->\n+      it 'marks the message as done', ->\n+        testMessage = new Message(@user)\n+        expect(testMessage.done).to.not.be.ok\n+        testMessage.finish()\n+        expect(testMessage.done).to.be.ok\n+\n+    describe 'TextMessage', ->\n+      describe '#match', ->\n+        it 'should perform standard regex matching', ->\n+          testMessage = new TextMessage(@user, 'message123')\n+          expect( testMessage.match(/^message123$/) ).to.be.ok\n+          expect( testMessage.match(/^does-not-match$/) ).to.not.be.ok\n+\n+  describe 'Message Processing', ->","path":"test/message_test.coffee","position":null,"original_position":41,"commit_id":"cc318c6204d5d22f986e4968a8dd12ae7fc753be","original_commit_id":"1fb021227886e705ea41b83c14914a9d50ae6024","user":{"login":"michaelansel","id":85195,"avatar_url":"https://avatars.githubusercontent.com/u/85195?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelansel","html_url":"https://github.com/michaelansel","followers_url":"https://api.github.com/users/michaelansel/followers","following_url":"https://api.github.com/users/michaelansel/following{/other_user}","gists_url":"https://api.github.com/users/michaelansel/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelansel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelansel/subscriptions","organizations_url":"https://api.github.com/users/michaelansel/orgs","repos_url":"https://api.github.com/users/michaelansel/repos","events_url":"https://api.github.com/users/michaelansel/events{/privacy}","received_events_url":"https://api.github.com/users/michaelansel/received_events","type":"User","site_admin":false},"body":"Removed","created_at":"2015-02-09T22:22:20Z","updated_at":"2015-02-09T22:22:20Z","html_url":"https://github.com/afeld/hubot/pull/1#discussion_r24371241","pull_request_url":"https://api.github.com/repos/afeld/hubot/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/afeld/hubot/pulls/comments/24371241"},"html":{"href":"https://github.com/afeld/hubot/pull/1#discussion_r24371241"},"pull_request":{"href":"https://api.github.com/repos/afeld/hubot/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/afeld/hubot/pulls/1","id":28871149,"html_url":"https://github.com/afeld/hubot/pull/1","diff_url":"https://github.com/afeld/hubot/pull/1.diff","patch_url":"https://github.com/afeld/hubot/pull/1.patch","issue_url":"https://api.github.com/repos/afeld/hubot/issues/1","number":1,"state":"open","locked":false,"title":"Add tests for message processing flow","user":{"login":"michaelansel","id":85195,"avatar_url":"https://avatars.githubusercontent.com/u/85195?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelansel","html_url":"https://github.com/michaelansel","followers_url":"https://api.github.com/users/michaelansel/followers","following_url":"https://api.github.com/users/michaelansel/following{/other_user}","gists_url":"https://api.github.com/users/michaelansel/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelansel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelansel/subscriptions","organizations_url":"https://api.github.com/users/michaelansel/orgs","repos_url":"https://api.github.com/users/michaelansel/repos","events_url":"https://api.github.com/users/michaelansel/events{/privacy}","received_events_url":"https://api.github.com/users/michaelansel/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-07T22:14:44Z","updated_at":"2015-02-09T22:22:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbebc0efb8e158e79e25d12e45f62e20b1121042","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/afeld/hubot/pulls/1/commits","review_comments_url":"https://api.github.com/repos/afeld/hubot/pulls/1/comments","review_comment_url":"https://api.github.com/repos/afeld/hubot/pulls/comments/{number}","comments_url":"https://api.github.com/repos/afeld/hubot/issues/1/comments","statuses_url":"https://api.github.com/repos/afeld/hubot/statuses/cc318c6204d5d22f986e4968a8dd12ae7fc753be","head":{"label":"michaelansel:testing","ref":"testing","sha":"cc318c6204d5d22f986e4968a8dd12ae7fc753be","user":{"login":"michaelansel","id":85195,"avatar_url":"https://avatars.githubusercontent.com/u/85195?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelansel","html_url":"https://github.com/michaelansel","followers_url":"https://api.github.com/users/michaelansel/followers","following_url":"https://api.github.com/users/michaelansel/following{/other_user}","gists_url":"https://api.github.com/users/michaelansel/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelansel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelansel/subscriptions","organizations_url":"https://api.github.com/users/michaelansel/orgs","repos_url":"https://api.github.com/users/michaelansel/repos","events_url":"https://api.github.com/users/michaelansel/events{/privacy}","received_events_url":"https://api.github.com/users/michaelansel/received_events","type":"User","site_admin":false},"repo":{"id":20673541,"name":"hubot","full_name":"michaelansel/hubot","owner":{"login":"michaelansel","id":85195,"avatar_url":"https://avatars.githubusercontent.com/u/85195?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelansel","html_url":"https://github.com/michaelansel","followers_url":"https://api.github.com/users/michaelansel/followers","following_url":"https://api.github.com/users/michaelansel/following{/other_user}","gists_url":"https://api.github.com/users/michaelansel/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelansel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelansel/subscriptions","organizations_url":"https://api.github.com/users/michaelansel/orgs","repos_url":"https://api.github.com/users/michaelansel/repos","events_url":"https://api.github.com/users/michaelansel/events{/privacy}","received_events_url":"https://api.github.com/users/michaelansel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michaelansel/hubot","description":"A customizable, kegerator-powered life embetterment robot.","fork":true,"url":"https://api.github.com/repos/michaelansel/hubot","forks_url":"https://api.github.com/repos/michaelansel/hubot/forks","keys_url":"https://api.github.com/repos/michaelansel/hubot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelansel/hubot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelansel/hubot/teams","hooks_url":"https://api.github.com/repos/michaelansel/hubot/hooks","issue_events_url":"https://api.github.com/repos/michaelansel/hubot/issues/events{/number}","events_url":"https://api.github.com/repos/michaelansel/hubot/events","assignees_url":"https://api.github.com/repos/michaelansel/hubot/assignees{/user}","branches_url":"https://api.github.com/repos/michaelansel/hubot/branches{/branch}","tags_url":"https://api.github.com/repos/michaelansel/hubot/tags","blobs_url":"https://api.github.com/repos/michaelansel/hubot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelansel/hubot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelansel/hubot/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelansel/hubot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelansel/hubot/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelansel/hubot/languages","stargazers_url":"https://api.github.com/repos/michaelansel/hubot/stargazers","contributors_url":"https://api.github.com/repos/michaelansel/hubot/contributors","subscribers_url":"https://api.github.com/repos/michaelansel/hubot/subscribers","subscription_url":"https://api.github.com/repos/michaelansel/hubot/subscription","commits_url":"https://api.github.com/repos/michaelansel/hubot/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelansel/hubot/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelansel/hubot/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelansel/hubot/issues/comments/{number}","contents_url":"https://api.github.com/repos/michaelansel/hubot/contents/{+path}","compare_url":"https://api.github.com/repos/michaelansel/hubot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelansel/hubot/merges","archive_url":"https://api.github.com/repos/michaelansel/hubot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelansel/hubot/downloads","issues_url":"https://api.github.com/repos/michaelansel/hubot/issues{/number}","pulls_url":"https://api.github.com/repos/michaelansel/hubot/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelansel/hubot/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelansel/hubot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelansel/hubot/labels{/name}","releases_url":"https://api.github.com/repos/michaelansel/hubot/releases{/id}","created_at":"2014-06-10T05:29:41Z","updated_at":"2014-06-27T04:22:59Z","pushed_at":"2015-02-09T22:18:35Z","git_url":"git://github.com/michaelansel/hubot.git","ssh_url":"git@github.com:michaelansel/hubot.git","clone_url":"https://github.com/michaelansel/hubot.git","svn_url":"https://github.com/michaelansel/hubot","homepage":"http://hubot.github.com","size":1668,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"afeld:testing","ref":"testing","sha":"6dc8db3288f72beb89f93daa399f0eef8f225db4","user":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"repo":{"id":28520894,"name":"hubot","full_name":"afeld/hubot","owner":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/afeld/hubot","description":"A customizable life embetterment robot.","fork":true,"url":"https://api.github.com/repos/afeld/hubot","forks_url":"https://api.github.com/repos/afeld/hubot/forks","keys_url":"https://api.github.com/repos/afeld/hubot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/afeld/hubot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/afeld/hubot/teams","hooks_url":"https://api.github.com/repos/afeld/hubot/hooks","issue_events_url":"https://api.github.com/repos/afeld/hubot/issues/events{/number}","events_url":"https://api.github.com/repos/afeld/hubot/events","assignees_url":"https://api.github.com/repos/afeld/hubot/assignees{/user}","branches_url":"https://api.github.com/repos/afeld/hubot/branches{/branch}","tags_url":"https://api.github.com/repos/afeld/hubot/tags","blobs_url":"https://api.github.com/repos/afeld/hubot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/afeld/hubot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/afeld/hubot/git/refs{/sha}","trees_url":"https://api.github.com/repos/afeld/hubot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/afeld/hubot/statuses/{sha}","languages_url":"https://api.github.com/repos/afeld/hubot/languages","stargazers_url":"https://api.github.com/repos/afeld/hubot/stargazers","contributors_url":"https://api.github.com/repos/afeld/hubot/contributors","subscribers_url":"https://api.github.com/repos/afeld/hubot/subscribers","subscription_url":"https://api.github.com/repos/afeld/hubot/subscription","commits_url":"https://api.github.com/repos/afeld/hubot/commits{/sha}","git_commits_url":"https://api.github.com/repos/afeld/hubot/git/commits{/sha}","comments_url":"https://api.github.com/repos/afeld/hubot/comments{/number}","issue_comment_url":"https://api.github.com/repos/afeld/hubot/issues/comments/{number}","contents_url":"https://api.github.com/repos/afeld/hubot/contents/{+path}","compare_url":"https://api.github.com/repos/afeld/hubot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/afeld/hubot/merges","archive_url":"https://api.github.com/repos/afeld/hubot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/afeld/hubot/downloads","issues_url":"https://api.github.com/repos/afeld/hubot/issues{/number}","pulls_url":"https://api.github.com/repos/afeld/hubot/pulls{/number}","milestones_url":"https://api.github.com/repos/afeld/hubot/milestones{/number}","notifications_url":"https://api.github.com/repos/afeld/hubot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/afeld/hubot/labels{/name}","releases_url":"https://api.github.com/repos/afeld/hubot/releases{/id}","created_at":"2014-12-26T20:52:20Z","updated_at":"2014-12-30T02:52:07Z","pushed_at":"2014-12-29T04:11:39Z","git_url":"git://github.com/afeld/hubot.git","ssh_url":"git@github.com:afeld/hubot.git","clone_url":"https://github.com/afeld/hubot.git","svn_url":"https://github.com/afeld/hubot","homepage":"http://hubot.github.com","size":1660,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/afeld/hubot/pulls/1"},"html":{"href":"https://github.com/afeld/hubot/pull/1"},"issue":{"href":"https://api.github.com/repos/afeld/hubot/issues/1"},"comments":{"href":"https://api.github.com/repos/afeld/hubot/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/afeld/hubot/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/afeld/hubot/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/afeld/hubot/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/afeld/hubot/statuses/cc318c6204d5d22f986e4968a8dd12ae7fc753be"}}}}