{"action":"created","comment":{"url":"https://api.github.com/repos/phemmer/sawmill/pulls/comments/31532727","id":31532727,"diff_hunk":"@@ -0,0 +1,82 @@\n+package capture\n+\n+import (\n+\t\"runtime\"\n+\t\"testing\"\n+\n+\t\"github.com/phemmer/sawmill\"\n+\t\"github.com/phemmer/sawmill/event\"\n+\t\"github.com/stretchr/testify/assert\"\n+)\n+\n+func Test_Handler_iface(t *testing.T) {\n+\tassert.Implements(t, (*sawmill.Handler)(nil), NewHandler())\n+}\n+\n+func Test_Event(t *testing.T) {\n+\tch := NewHandler()\n+\tlogEvent0 := makeEvent(0)\n+\tlogEvent1 := makeEvent(1)\n+\tlogEvent2 := makeEvent(2)\n+\n+\tch.Event(logEvent0)\n+\tch.Event(logEvent1)\n+\tch.Event(logEvent2)\n+\n+\tassert.Equal(t, logEvent0, ch.events[0])\n+\tassert.Equal(t, logEvent1, ch.events[1])\n+\tassert.Equal(t, logEvent2, ch.events[2])\n+}\n+\n+func Test_Last(t *testing.T) {\n+\tch := NewHandler()\n+\tlogEvent2 := makeEvent(2)\n+\n+\tch.Event(makeEvent(0))\n+\tch.Event(makeEvent(1))\n+\tch.Event(logEvent2)\n+\n+\tassert.Equal(t, logEvent2, ch.Last())\n+}\n+\n+func Test_Events(t *testing.T) {\n+\tch := NewHandler()\n+\tevents := []*event.Event{\n+\t\tmakeEvent(0),\n+\t\tmakeEvent(1),\n+\t\tmakeEvent(2),\n+\t}\n+\n+\tfor _, e := range events {\n+\t\tch.Event(e)\n+\t}\n+\n+\tassert.Equal(t, events, ch.Events())","path":"handler/capture/capture_test.go","position":54,"original_position":54,"commit_id":"f90fc5d13e5fcdf749b58e4bb5c70df6c281f0de","original_commit_id":"f90fc5d13e5fcdf749b58e4bb5c70df6c281f0de","user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"body":"This test appears to be doing the same thing as `Test_Event`.","created_at":"2015-06-02T15:07:26Z","updated_at":"2015-06-02T15:07:26Z","html_url":"https://github.com/phemmer/sawmill/pull/46#discussion_r31532727","pull_request_url":"https://api.github.com/repos/phemmer/sawmill/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/phemmer/sawmill/pulls/comments/31532727"},"html":{"href":"https://github.com/phemmer/sawmill/pull/46#discussion_r31532727"},"pull_request":{"href":"https://api.github.com/repos/phemmer/sawmill/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/phemmer/sawmill/pulls/46","id":36736388,"html_url":"https://github.com/phemmer/sawmill/pull/46","diff_url":"https://github.com/phemmer/sawmill/pull/46.diff","patch_url":"https://github.com/phemmer/sawmill/pull/46.patch","issue_url":"https://api.github.com/repos/phemmer/sawmill/issues/46","number":46,"state":"open","locked":false,"title":"Export Channel and Capture Handlers","user":{"login":"MrGossett","id":15857,"avatar_url":"https://avatars.githubusercontent.com/u/15857?v=3","gravatar_id":"","url":"https://api.github.com/users/MrGossett","html_url":"https://github.com/MrGossett","followers_url":"https://api.github.com/users/MrGossett/followers","following_url":"https://api.github.com/users/MrGossett/following{/other_user}","gists_url":"https://api.github.com/users/MrGossett/gists{/gist_id}","starred_url":"https://api.github.com/users/MrGossett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrGossett/subscriptions","organizations_url":"https://api.github.com/users/MrGossett/orgs","repos_url":"https://api.github.com/users/MrGossett/repos","events_url":"https://api.github.com/users/MrGossett/events{/privacy}","received_events_url":"https://api.github.com/users/MrGossett/received_events","type":"User","site_admin":false},"body":"The Channel and Capture handlers were written for `sawmill`'s local test suite. They're also useful in the test suites of external projects using `sawmill`.\r\n\r\nThis PR moves the handlers out of `sawmill`'s test suite and exports them as regular handlers alongside `sentry`, `splunk`, etc. It also updates the tests for the `filter` handler and the top-level package tests to dog-food these handlers instead of using local implementations.","created_at":"2015-06-02T14:45:56Z","updated_at":"2015-06-02T15:07:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"baaffa90f0e7ddea347345fb5ae4ee5bd33cce73","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phemmer/sawmill/pulls/46/commits","review_comments_url":"https://api.github.com/repos/phemmer/sawmill/pulls/46/comments","review_comment_url":"https://api.github.com/repos/phemmer/sawmill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phemmer/sawmill/issues/46/comments","statuses_url":"https://api.github.com/repos/phemmer/sawmill/statuses/f90fc5d13e5fcdf749b58e4bb5c70df6c281f0de","head":{"label":"MrGossett:export-handlers","ref":"export-handlers","sha":"f90fc5d13e5fcdf749b58e4bb5c70df6c281f0de","user":{"login":"MrGossett","id":15857,"avatar_url":"https://avatars.githubusercontent.com/u/15857?v=3","gravatar_id":"","url":"https://api.github.com/users/MrGossett","html_url":"https://github.com/MrGossett","followers_url":"https://api.github.com/users/MrGossett/followers","following_url":"https://api.github.com/users/MrGossett/following{/other_user}","gists_url":"https://api.github.com/users/MrGossett/gists{/gist_id}","starred_url":"https://api.github.com/users/MrGossett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrGossett/subscriptions","organizations_url":"https://api.github.com/users/MrGossett/orgs","repos_url":"https://api.github.com/users/MrGossett/repos","events_url":"https://api.github.com/users/MrGossett/events{/privacy}","received_events_url":"https://api.github.com/users/MrGossett/received_events","type":"User","site_admin":false},"repo":{"id":30304830,"name":"sawmill","full_name":"MrGossett/sawmill","owner":{"login":"MrGossett","id":15857,"avatar_url":"https://avatars.githubusercontent.com/u/15857?v=3","gravatar_id":"","url":"https://api.github.com/users/MrGossett","html_url":"https://github.com/MrGossett","followers_url":"https://api.github.com/users/MrGossett/followers","following_url":"https://api.github.com/users/MrGossett/following{/other_user}","gists_url":"https://api.github.com/users/MrGossett/gists{/gist_id}","starred_url":"https://api.github.com/users/MrGossett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrGossett/subscriptions","organizations_url":"https://api.github.com/users/MrGossett/orgs","repos_url":"https://api.github.com/users/MrGossett/repos","events_url":"https://api.github.com/users/MrGossett/events{/privacy}","received_events_url":"https://api.github.com/users/MrGossett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MrGossett/sawmill","description":"","fork":true,"url":"https://api.github.com/repos/MrGossett/sawmill","forks_url":"https://api.github.com/repos/MrGossett/sawmill/forks","keys_url":"https://api.github.com/repos/MrGossett/sawmill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MrGossett/sawmill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MrGossett/sawmill/teams","hooks_url":"https://api.github.com/repos/MrGossett/sawmill/hooks","issue_events_url":"https://api.github.com/repos/MrGossett/sawmill/issues/events{/number}","events_url":"https://api.github.com/repos/MrGossett/sawmill/events","assignees_url":"https://api.github.com/repos/MrGossett/sawmill/assignees{/user}","branches_url":"https://api.github.com/repos/MrGossett/sawmill/branches{/branch}","tags_url":"https://api.github.com/repos/MrGossett/sawmill/tags","blobs_url":"https://api.github.com/repos/MrGossett/sawmill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MrGossett/sawmill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MrGossett/sawmill/git/refs{/sha}","trees_url":"https://api.github.com/repos/MrGossett/sawmill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MrGossett/sawmill/statuses/{sha}","languages_url":"https://api.github.com/repos/MrGossett/sawmill/languages","stargazers_url":"https://api.github.com/repos/MrGossett/sawmill/stargazers","contributors_url":"https://api.github.com/repos/MrGossett/sawmill/contributors","subscribers_url":"https://api.github.com/repos/MrGossett/sawmill/subscribers","subscription_url":"https://api.github.com/repos/MrGossett/sawmill/subscription","commits_url":"https://api.github.com/repos/MrGossett/sawmill/commits{/sha}","git_commits_url":"https://api.github.com/repos/MrGossett/sawmill/git/commits{/sha}","comments_url":"https://api.github.com/repos/MrGossett/sawmill/comments{/number}","issue_comment_url":"https://api.github.com/repos/MrGossett/sawmill/issues/comments{/number}","contents_url":"https://api.github.com/repos/MrGossett/sawmill/contents/{+path}","compare_url":"https://api.github.com/repos/MrGossett/sawmill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MrGossett/sawmill/merges","archive_url":"https://api.github.com/repos/MrGossett/sawmill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MrGossett/sawmill/downloads","issues_url":"https://api.github.com/repos/MrGossett/sawmill/issues{/number}","pulls_url":"https://api.github.com/repos/MrGossett/sawmill/pulls{/number}","milestones_url":"https://api.github.com/repos/MrGossett/sawmill/milestones{/number}","notifications_url":"https://api.github.com/repos/MrGossett/sawmill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MrGossett/sawmill/labels{/name}","releases_url":"https://api.github.com/repos/MrGossett/sawmill/releases{/id}","created_at":"2015-02-04T15:13:28Z","updated_at":"2015-02-04T15:13:28Z","pushed_at":"2015-06-02T14:41:29Z","git_url":"git://github.com/MrGossett/sawmill.git","ssh_url":"git@github.com:MrGossett/sawmill.git","clone_url":"https://github.com/MrGossett/sawmill.git","svn_url":"https://github.com/MrGossett/sawmill","homepage":null,"size":124,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"phemmer:master","ref":"master","sha":"e3a465d918471608245572a3c97c50f4887e5357","user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"repo":{"id":29219471,"name":"sawmill","full_name":"phemmer/sawmill","owner":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phemmer/sawmill","description":"Structured event logger for GO","fork":false,"url":"https://api.github.com/repos/phemmer/sawmill","forks_url":"https://api.github.com/repos/phemmer/sawmill/forks","keys_url":"https://api.github.com/repos/phemmer/sawmill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phemmer/sawmill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phemmer/sawmill/teams","hooks_url":"https://api.github.com/repos/phemmer/sawmill/hooks","issue_events_url":"https://api.github.com/repos/phemmer/sawmill/issues/events{/number}","events_url":"https://api.github.com/repos/phemmer/sawmill/events","assignees_url":"https://api.github.com/repos/phemmer/sawmill/assignees{/user}","branches_url":"https://api.github.com/repos/phemmer/sawmill/branches{/branch}","tags_url":"https://api.github.com/repos/phemmer/sawmill/tags","blobs_url":"https://api.github.com/repos/phemmer/sawmill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phemmer/sawmill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phemmer/sawmill/git/refs{/sha}","trees_url":"https://api.github.com/repos/phemmer/sawmill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phemmer/sawmill/statuses/{sha}","languages_url":"https://api.github.com/repos/phemmer/sawmill/languages","stargazers_url":"https://api.github.com/repos/phemmer/sawmill/stargazers","contributors_url":"https://api.github.com/repos/phemmer/sawmill/contributors","subscribers_url":"https://api.github.com/repos/phemmer/sawmill/subscribers","subscription_url":"https://api.github.com/repos/phemmer/sawmill/subscription","commits_url":"https://api.github.com/repos/phemmer/sawmill/commits{/sha}","git_commits_url":"https://api.github.com/repos/phemmer/sawmill/git/commits{/sha}","comments_url":"https://api.github.com/repos/phemmer/sawmill/comments{/number}","issue_comment_url":"https://api.github.com/repos/phemmer/sawmill/issues/comments{/number}","contents_url":"https://api.github.com/repos/phemmer/sawmill/contents/{+path}","compare_url":"https://api.github.com/repos/phemmer/sawmill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phemmer/sawmill/merges","archive_url":"https://api.github.com/repos/phemmer/sawmill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phemmer/sawmill/downloads","issues_url":"https://api.github.com/repos/phemmer/sawmill/issues{/number}","pulls_url":"https://api.github.com/repos/phemmer/sawmill/pulls{/number}","milestones_url":"https://api.github.com/repos/phemmer/sawmill/milestones{/number}","notifications_url":"https://api.github.com/repos/phemmer/sawmill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phemmer/sawmill/labels{/name}","releases_url":"https://api.github.com/repos/phemmer/sawmill/releases{/id}","created_at":"2015-01-14T00:42:15Z","updated_at":"2015-05-05T23:35:21Z","pushed_at":"2015-06-02T14:45:56Z","git_url":"git://github.com/phemmer/sawmill.git","ssh_url":"git@github.com:phemmer/sawmill.git","clone_url":"https://github.com/phemmer/sawmill.git","svn_url":"https://github.com/phemmer/sawmill","homepage":"http://godoc.org/github.com/phemmer/sawmill","size":1315,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phemmer/sawmill/pulls/46"},"html":{"href":"https://github.com/phemmer/sawmill/pull/46"},"issue":{"href":"https://api.github.com/repos/phemmer/sawmill/issues/46"},"comments":{"href":"https://api.github.com/repos/phemmer/sawmill/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/phemmer/sawmill/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/phemmer/sawmill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phemmer/sawmill/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/phemmer/sawmill/statuses/f90fc5d13e5fcdf749b58e4bb5c70df6c281f0de"}}}}