{"action":"created","comment":{"url":"https://api.github.com/repos/hspec/autospec/pulls/comments/28941806","id":28941806,"diff_hunk":"@@ -32,5 +39,20 @@ close = GhciWrapper.close . sessionInterpreter\n reload :: Session -> IO String\n reload Session{..} = evalEcho sessionInterpreter \":reload\"\n \n-hspec :: Session -> IO String\n-hspec Session{..} = evalEcho sessionInterpreter $ \"System.Environment.withArgs \" ++ (show $ \"--color\" : sessionHspecArgs) ++ \" $ Test.Hspec.hspec spec\"\n+data Summary = Summary {\n+  summaryExamples :: Int\n+, summaryFailures :: Int\n+} deriving (Eq, Show, Read)\n+\n+hspec :: Session -> IO (String, Maybe Summary)\n+hspec Session{..} = do\n+  r <- evalEcho sessionInterpreter $ \"System.Environment.withArgs \" ++ (show $ \"--color\" : sessionHspecArgs) ++ \" $ Test.Hspec.Runner.hspecResult spec\"\n+  return $ case reverse $ lines r of\n+    x : _ | Just summary <- readMaybe (dropAnsiEscapeSequences x) -> (r, Just summary)\n+    _ -> (r, Nothing)\n+  where\n+    dropAnsiEscapeSequences xs\n+      | \"Summary\" `isPrefixOf` xs = xs\n+      | otherwise = case xs of\n+          _ : ys -> dropAnsiEscapeSequences ys\n+          [] -> []","path":"src/Interpreter.hs","position":48,"original_position":48,"commit_id":"eddba3ca5af1528b466afa43b8e7b06311742d03","original_commit_id":"eddba3ca5af1528b466afa43b8e7b06311742d03","user":{"login":"soenkehahn","id":402539,"avatar_url":"https://avatars.githubusercontent.com/u/402539?v=3","gravatar_id":"","url":"https://api.github.com/users/soenkehahn","html_url":"https://github.com/soenkehahn","followers_url":"https://api.github.com/users/soenkehahn/followers","following_url":"https://api.github.com/users/soenkehahn/following{/other_user}","gists_url":"https://api.github.com/users/soenkehahn/gists{/gist_id}","starred_url":"https://api.github.com/users/soenkehahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soenkehahn/subscriptions","organizations_url":"https://api.github.com/users/soenkehahn/orgs","repos_url":"https://api.github.com/users/soenkehahn/repos","events_url":"https://api.github.com/users/soenkehahn/events{/privacy}","received_events_url":"https://api.github.com/users/soenkehahn/received_events","type":"User","site_admin":false},"body":"Why is this needed? Why do we drop the first character when the string doesn't start with `\"Summary\"`?","created_at":"2015-04-23T07:36:24Z","updated_at":"2015-04-23T07:36:24Z","html_url":"https://github.com/hspec/autospec/pull/11#discussion_r28941806","pull_request_url":"https://api.github.com/repos/hspec/autospec/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/hspec/autospec/pulls/comments/28941806"},"html":{"href":"https://github.com/hspec/autospec/pull/11#discussion_r28941806"},"pull_request":{"href":"https://api.github.com/repos/hspec/autospec/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/hspec/autospec/pulls/11","id":33926003,"html_url":"https://github.com/hspec/autospec/pull/11","diff_url":"https://github.com/hspec/autospec/pull/11.diff","patch_url":"https://github.com/hspec/autospec/pull/11.patch","issue_url":"https://api.github.com/repos/hspec/autospec/issues/11","number":11,"state":"open","locked":false,"title":"Respond with HTTP status 412 on failure (fixes #8)","user":{"login":"sol","id":461132,"avatar_url":"https://avatars.githubusercontent.com/u/461132?v=3","gravatar_id":"","url":"https://api.github.com/users/sol","html_url":"https://github.com/sol","followers_url":"https://api.github.com/users/sol/followers","following_url":"https://api.github.com/users/sol/following{/other_user}","gists_url":"https://api.github.com/users/sol/gists{/gist_id}","starred_url":"https://api.github.com/users/sol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sol/subscriptions","organizations_url":"https://api.github.com/users/sol/orgs","repos_url":"https://api.github.com/users/sol/repos","events_url":"https://api.github.com/users/sol/events{/privacy}","received_events_url":"https://api.github.com/users/sol/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-23T05:51:41Z","updated_at":"2015-04-23T07:36:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61640741a6b77527e72d7e31cbe781fcf03f8111","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hspec/autospec/pulls/11/commits","review_comments_url":"https://api.github.com/repos/hspec/autospec/pulls/11/comments","review_comment_url":"https://api.github.com/repos/hspec/autospec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hspec/autospec/issues/11/comments","statuses_url":"https://api.github.com/repos/hspec/autospec/statuses/eddba3ca5af1528b466afa43b8e7b06311742d03","head":{"label":"hspec:http-failure","ref":"http-failure","sha":"eddba3ca5af1528b466afa43b8e7b06311742d03","user":{"login":"hspec","id":1610185,"avatar_url":"https://avatars.githubusercontent.com/u/1610185?v=3","gravatar_id":"","url":"https://api.github.com/users/hspec","html_url":"https://github.com/hspec","followers_url":"https://api.github.com/users/hspec/followers","following_url":"https://api.github.com/users/hspec/following{/other_user}","gists_url":"https://api.github.com/users/hspec/gists{/gist_id}","starred_url":"https://api.github.com/users/hspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hspec/subscriptions","organizations_url":"https://api.github.com/users/hspec/orgs","repos_url":"https://api.github.com/users/hspec/repos","events_url":"https://api.github.com/users/hspec/events{/privacy}","received_events_url":"https://api.github.com/users/hspec/received_events","type":"Organization","site_admin":false},"repo":{"id":33900202,"name":"autospec","full_name":"hspec/autospec","owner":{"login":"hspec","id":1610185,"avatar_url":"https://avatars.githubusercontent.com/u/1610185?v=3","gravatar_id":"","url":"https://api.github.com/users/hspec","html_url":"https://github.com/hspec","followers_url":"https://api.github.com/users/hspec/followers","following_url":"https://api.github.com/users/hspec/following{/other_user}","gists_url":"https://api.github.com/users/hspec/gists{/gist_id}","starred_url":"https://api.github.com/users/hspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hspec/subscriptions","organizations_url":"https://api.github.com/users/hspec/orgs","repos_url":"https://api.github.com/users/hspec/repos","events_url":"https://api.github.com/users/hspec/events{/privacy}","received_events_url":"https://api.github.com/users/hspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hspec/autospec","description":"","fork":false,"url":"https://api.github.com/repos/hspec/autospec","forks_url":"https://api.github.com/repos/hspec/autospec/forks","keys_url":"https://api.github.com/repos/hspec/autospec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hspec/autospec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hspec/autospec/teams","hooks_url":"https://api.github.com/repos/hspec/autospec/hooks","issue_events_url":"https://api.github.com/repos/hspec/autospec/issues/events{/number}","events_url":"https://api.github.com/repos/hspec/autospec/events","assignees_url":"https://api.github.com/repos/hspec/autospec/assignees{/user}","branches_url":"https://api.github.com/repos/hspec/autospec/branches{/branch}","tags_url":"https://api.github.com/repos/hspec/autospec/tags","blobs_url":"https://api.github.com/repos/hspec/autospec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hspec/autospec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hspec/autospec/git/refs{/sha}","trees_url":"https://api.github.com/repos/hspec/autospec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hspec/autospec/statuses/{sha}","languages_url":"https://api.github.com/repos/hspec/autospec/languages","stargazers_url":"https://api.github.com/repos/hspec/autospec/stargazers","contributors_url":"https://api.github.com/repos/hspec/autospec/contributors","subscribers_url":"https://api.github.com/repos/hspec/autospec/subscribers","subscription_url":"https://api.github.com/repos/hspec/autospec/subscription","commits_url":"https://api.github.com/repos/hspec/autospec/commits{/sha}","git_commits_url":"https://api.github.com/repos/hspec/autospec/git/commits{/sha}","comments_url":"https://api.github.com/repos/hspec/autospec/comments{/number}","issue_comment_url":"https://api.github.com/repos/hspec/autospec/issues/comments{/number}","contents_url":"https://api.github.com/repos/hspec/autospec/contents/{+path}","compare_url":"https://api.github.com/repos/hspec/autospec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hspec/autospec/merges","archive_url":"https://api.github.com/repos/hspec/autospec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hspec/autospec/downloads","issues_url":"https://api.github.com/repos/hspec/autospec/issues{/number}","pulls_url":"https://api.github.com/repos/hspec/autospec/pulls{/number}","milestones_url":"https://api.github.com/repos/hspec/autospec/milestones{/number}","notifications_url":"https://api.github.com/repos/hspec/autospec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hspec/autospec/labels{/name}","releases_url":"https://api.github.com/repos/hspec/autospec/releases{/id}","created_at":"2015-04-13T23:46:24Z","updated_at":"2015-04-23T05:57:37Z","pushed_at":"2015-04-23T05:57:52Z","git_url":"git://github.com/hspec/autospec.git","ssh_url":"git@github.com:hspec/autospec.git","clone_url":"https://github.com/hspec/autospec.git","svn_url":"https://github.com/hspec/autospec","homepage":null,"size":276,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"hspec:master","ref":"master","sha":"9f77acd02e1558210a0f46e2b13a69e1c1d84db0","user":{"login":"hspec","id":1610185,"avatar_url":"https://avatars.githubusercontent.com/u/1610185?v=3","gravatar_id":"","url":"https://api.github.com/users/hspec","html_url":"https://github.com/hspec","followers_url":"https://api.github.com/users/hspec/followers","following_url":"https://api.github.com/users/hspec/following{/other_user}","gists_url":"https://api.github.com/users/hspec/gists{/gist_id}","starred_url":"https://api.github.com/users/hspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hspec/subscriptions","organizations_url":"https://api.github.com/users/hspec/orgs","repos_url":"https://api.github.com/users/hspec/repos","events_url":"https://api.github.com/users/hspec/events{/privacy}","received_events_url":"https://api.github.com/users/hspec/received_events","type":"Organization","site_admin":false},"repo":{"id":33900202,"name":"autospec","full_name":"hspec/autospec","owner":{"login":"hspec","id":1610185,"avatar_url":"https://avatars.githubusercontent.com/u/1610185?v=3","gravatar_id":"","url":"https://api.github.com/users/hspec","html_url":"https://github.com/hspec","followers_url":"https://api.github.com/users/hspec/followers","following_url":"https://api.github.com/users/hspec/following{/other_user}","gists_url":"https://api.github.com/users/hspec/gists{/gist_id}","starred_url":"https://api.github.com/users/hspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hspec/subscriptions","organizations_url":"https://api.github.com/users/hspec/orgs","repos_url":"https://api.github.com/users/hspec/repos","events_url":"https://api.github.com/users/hspec/events{/privacy}","received_events_url":"https://api.github.com/users/hspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hspec/autospec","description":"","fork":false,"url":"https://api.github.com/repos/hspec/autospec","forks_url":"https://api.github.com/repos/hspec/autospec/forks","keys_url":"https://api.github.com/repos/hspec/autospec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hspec/autospec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hspec/autospec/teams","hooks_url":"https://api.github.com/repos/hspec/autospec/hooks","issue_events_url":"https://api.github.com/repos/hspec/autospec/issues/events{/number}","events_url":"https://api.github.com/repos/hspec/autospec/events","assignees_url":"https://api.github.com/repos/hspec/autospec/assignees{/user}","branches_url":"https://api.github.com/repos/hspec/autospec/branches{/branch}","tags_url":"https://api.github.com/repos/hspec/autospec/tags","blobs_url":"https://api.github.com/repos/hspec/autospec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hspec/autospec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hspec/autospec/git/refs{/sha}","trees_url":"https://api.github.com/repos/hspec/autospec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hspec/autospec/statuses/{sha}","languages_url":"https://api.github.com/repos/hspec/autospec/languages","stargazers_url":"https://api.github.com/repos/hspec/autospec/stargazers","contributors_url":"https://api.github.com/repos/hspec/autospec/contributors","subscribers_url":"https://api.github.com/repos/hspec/autospec/subscribers","subscription_url":"https://api.github.com/repos/hspec/autospec/subscription","commits_url":"https://api.github.com/repos/hspec/autospec/commits{/sha}","git_commits_url":"https://api.github.com/repos/hspec/autospec/git/commits{/sha}","comments_url":"https://api.github.com/repos/hspec/autospec/comments{/number}","issue_comment_url":"https://api.github.com/repos/hspec/autospec/issues/comments{/number}","contents_url":"https://api.github.com/repos/hspec/autospec/contents/{+path}","compare_url":"https://api.github.com/repos/hspec/autospec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hspec/autospec/merges","archive_url":"https://api.github.com/repos/hspec/autospec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hspec/autospec/downloads","issues_url":"https://api.github.com/repos/hspec/autospec/issues{/number}","pulls_url":"https://api.github.com/repos/hspec/autospec/pulls{/number}","milestones_url":"https://api.github.com/repos/hspec/autospec/milestones{/number}","notifications_url":"https://api.github.com/repos/hspec/autospec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hspec/autospec/labels{/name}","releases_url":"https://api.github.com/repos/hspec/autospec/releases{/id}","created_at":"2015-04-13T23:46:24Z","updated_at":"2015-04-23T05:57:37Z","pushed_at":"2015-04-23T05:57:52Z","git_url":"git://github.com/hspec/autospec.git","ssh_url":"git@github.com:hspec/autospec.git","clone_url":"https://github.com/hspec/autospec.git","svn_url":"https://github.com/hspec/autospec","homepage":null,"size":276,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hspec/autospec/pulls/11"},"html":{"href":"https://github.com/hspec/autospec/pull/11"},"issue":{"href":"https://api.github.com/repos/hspec/autospec/issues/11"},"comments":{"href":"https://api.github.com/repos/hspec/autospec/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/hspec/autospec/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/hspec/autospec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hspec/autospec/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/hspec/autospec/statuses/eddba3ca5af1528b466afa43b8e7b06311742d03"}}}}