GitHub PullRequestReviewCommentEvent at 2014-09-26 19:23:41
Repository: level_up_exercises
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments/18108514","id":18108514,"diff_hunk":"@@ -0,0 +1,91 @@\n+# require './calc_split_test'\n+require 'rubygems'\n+require_relative '../../lib/stat_calculator.rb'\n+require_relative './matchers.rb'\n+require 'rspec/expectations'\n+require 'pry'\n+require_relative './stat_calculator_spec_helper.rb'\n+\n+describe StatCalculator, 'conversion_rate' do\n+\n+\n+  RSpec.configuration do |config|\n+    config.include Matchers\n+  end\n+\n+  RSpec::Matchers.define :an_exception_caused_by do |cause|\n+    match do |exception|\n+      cause === exception.cause\n+    end\n+  end\n+\n+  let(:stat_calc) { StatCalculator.new }\n+\n+  it \"should calculate conversion rate accurately\" do\n+    expect([12,45]).to have_conversion_rate(0.27)\n+  end\n+\n+  it \"should raise error when number of trails is 0 or negative\" do\n+     ex = ERRORS[:conversion][:trials_zero_or_negative]\n+     expect{ stat_calc.conversion_rate(36, 0) }.to raise_error(*ex)\n+     expect{ stat_calc.conversion_rate(14, -2) }.to raise_error(*ex)\n+  end\n+\n+  it \"should raise error when conversion is greater than 1\" do\n+   ex = ERRORS[:conversion][:success_greater_trial]\n+   expect{ stat_calc.conversion_rate(4,1) }.to raise_error(*ex)\n+  end\n+\n+  it \"should raise error when number of success is 0 or negative\" do\n+    ex = ERRORS[:conversion][:success_zero_or_negative]\n+    expect{ stat_calc.conversion_rate(0,78) }.to raise_error(*ex)\n+    expect{ stat_calc.conversion_rate(-3, 45) }.to raise_error(*ex)\n+  end\n+end\n+\n+describe StatCalculator, 'standard_error' do\n+\n+  let(:stat_calc) { StatCalculator.new }\n+\n+  it \"should calculate standard error accurately\" do\n+    expect([0.27,45]).to have_standard_error(0.066)\n+  end\n+\n+  it \"should raise error when conversion rate is 0 or negative\" do\n+    ex = ERRORS[:standard_error][:conv_zero_or_negative]\n+    expect{ stat_calc.standard_error(0,39) }.to raise_error(*ex)\n+    expect{ stat_calc.standard_error(-2, 40) }.to raise_error(*ex)\n+  end\n+\n+  it \"should raise error when number of trials is 0 or negative\" do\n+    ex = ERRORS[:conversion][:trials_zero_or_negative]\n+    expect{ stat_calc.standard_error(4,0) }.to raise_error(*ex)\n+    expect{ stat_calc.standard_error(9,-2) }.to raise_error(*ex)\n+  end\n+\n+  it \"should raise error when conversion rate greater than or equal to 1\" do\n+    ex = ERRORS[:standard_error][:conv_greater_one]\n+    expect{ stat_calc.standard_error(1.2, 46) }.to raise_error(*ex)\n+  end\n+end\n+\n+describe StatCalculator, 'confidence' do\n+\n+  let(:stat_calc) { StatCalculator.new }\n+\n+   it \"should calculate confidence accuartely\" do\n+    expect([0.066,0.27]).to have_confidence([7.14, 6.06])\n+  end","path":"data_science/spec/lib/stat_calculator_spec.rb","position":78,"original_position":78,"commit_id":"0896aa3d4fb3db1d5cd88b213b6fdbe7f80765c2","original_commit_id":"0896aa3d4fb3db1d5cd88b213b6fdbe7f80765c2","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=2","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"`end` at 78, 2 is not aligned with `it \"should calculate confidence accuartely\" do` at 76, 3","created_at":"2014-09-26T19:23:41Z","updated_at":"2014-09-26T19:23:41Z","html_url":"https://github.com/jmmastey/level_up_exercises/pull/97#discussion_r18108514","pull_request_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments/18108514"},"html":{"href":"https://github.com/jmmastey/level_up_exercises/pull/97#discussion_r18108514"},"pull_request":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97","id":21869599,"html_url":"https://github.com/jmmastey/level_up_exercises/pull/97","diff_url":"https://github.com/jmmastey/level_up_exercises/pull/97.diff","patch_url":"https://github.com/jmmastey/level_up_exercises/pull/97.patch","issue_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/97","number":97,"state":"open","locked":false,"title":"Overlord up for first review","user":{"login":"rkannan1","id":8366569,"avatar_url":"https://avatars.githubusercontent.com/u/8366569?v=2","gravatar_id":"","url":"https://api.github.com/users/rkannan1","html_url":"https://github.com/rkannan1","followers_url":"https://api.github.com/users/rkannan1/followers","following_url":"https://api.github.com/users/rkannan1/following{/other_user}","gists_url":"https://api.github.com/users/rkannan1/gists{/gist_id}","starred_url":"https://api.github.com/users/rkannan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkannan1/subscriptions","organizations_url":"https://api.github.com/users/rkannan1/orgs","repos_url":"https://api.github.com/users/rkannan1/repos","events_url":"https://api.github.com/users/rkannan1/events{/privacy}","received_events_url":"https://api.github.com/users/rkannan1/received_events","type":"User","site_admin":false},"body":"overlord is up for first round of review. Main ruby file is bomb_setup.rb\r\n","created_at":"2014-09-26T19:23:21Z","updated_at":"2014-09-26T19:23:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efefbc1c6dde2757002f65dae7178102ada29221","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97/commits","review_comments_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97/comments","review_comment_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/97/comments","statuses_url":"https://api.github.com/repos/jmmastey/level_up_exercises/statuses/0896aa3d4fb3db1d5cd88b213b6fdbe7f80765c2","head":{"label":"rkannan1:master","ref":"master","sha":"0896aa3d4fb3db1d5cd88b213b6fdbe7f80765c2","user":{"login":"rkannan1","id":8366569,"avatar_url":"https://avatars.githubusercontent.com/u/8366569?v=2","gravatar_id":"","url":"https://api.github.com/users/rkannan1","html_url":"https://github.com/rkannan1","followers_url":"https://api.github.com/users/rkannan1/followers","following_url":"https://api.github.com/users/rkannan1/following{/other_user}","gists_url":"https://api.github.com/users/rkannan1/gists{/gist_id}","starred_url":"https://api.github.com/users/rkannan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkannan1/subscriptions","organizations_url":"https://api.github.com/users/rkannan1/orgs","repos_url":"https://api.github.com/users/rkannan1/repos","events_url":"https://api.github.com/users/rkannan1/events{/privacy}","received_events_url":"https://api.github.com/users/rkannan1/received_events","type":"User","site_admin":false},"repo":{"id":23088431,"name":"level_up_exercises","full_name":"rkannan1/level_up_exercises","owner":{"login":"rkannan1","id":8366569,"avatar_url":"https://avatars.githubusercontent.com/u/8366569?v=2","gravatar_id":"","url":"https://api.github.com/users/rkannan1","html_url":"https://github.com/rkannan1","followers_url":"https://api.github.com/users/rkannan1/followers","following_url":"https://api.github.com/users/rkannan1/following{/other_user}","gists_url":"https://api.github.com/users/rkannan1/gists{/gist_id}","starred_url":"https://api.github.com/users/rkannan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkannan1/subscriptions","organizations_url":"https://api.github.com/users/rkannan1/orgs","repos_url":"https://api.github.com/users/rkannan1/repos","events_url":"https://api.github.com/users/rkannan1/events{/privacy}","received_events_url":"https://api.github.com/users/rkannan1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkannan1/level_up_exercises","description":"A long series of code-related assignments to challenge starting engineers","fork":true,"url":"https://api.github.com/repos/rkannan1/level_up_exercises","forks_url":"https://api.github.com/repos/rkannan1/level_up_exercises/forks","keys_url":"https://api.github.com/repos/rkannan1/level_up_exercises/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkannan1/level_up_exercises/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkannan1/level_up_exercises/teams","hooks_url":"https://api.github.com/repos/rkannan1/level_up_exercises/hooks","issue_events_url":"https://api.github.com/repos/rkannan1/level_up_exercises/issues/events{/number}","events_url":"https://api.github.com/repos/rkannan1/level_up_exercises/events","assignees_url":"https://api.github.com/repos/rkannan1/level_up_exercises/assignees{/user}","branches_url":"https://api.github.com/repos/rkannan1/level_up_exercises/branches{/branch}","tags_url":"https://api.github.com/repos/rkannan1/level_up_exercises/tags","blobs_url":"https://api.github.com/repos/rkannan1/level_up_exercises/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkannan1/level_up_exercises/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkannan1/level_up_exercises/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkannan1/level_up_exercises/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkannan1/level_up_exercises/statuses/{sha}","languages_url":"https://api.github.com/repos/rkannan1/level_up_exercises/languages","stargazers_url":"https://api.github.com/repos/rkannan1/level_up_exercises/stargazers","contributors_url":"https://api.github.com/repos/rkannan1/level_up_exercises/contributors","subscribers_url":"https://api.github.com/repos/rkannan1/level_up_exercises/subscribers","subscription_url":"https://api.github.com/repos/rkannan1/level_up_exercises/subscription","commits_url":"https://api.github.com/repos/rkannan1/level_up_exercises/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkannan1/level_up_exercises/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkannan1/level_up_exercises/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkannan1/level_up_exercises/issues/comments/{number}","contents_url":"https://api.github.com/repos/rkannan1/level_up_exercises/contents/{+path}","compare_url":"https://api.github.com/repos/rkannan1/level_up_exercises/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkannan1/level_up_exercises/merges","archive_url":"https://api.github.com/repos/rkannan1/level_up_exercises/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkannan1/level_up_exercises/downloads","issues_url":"https://api.github.com/repos/rkannan1/level_up_exercises/issues{/number}","pulls_url":"https://api.github.com/repos/rkannan1/level_up_exercises/pulls{/number}","milestones_url":"https://api.github.com/repos/rkannan1/level_up_exercises/milestones{/number}","notifications_url":"https://api.github.com/repos/rkannan1/level_up_exercises/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkannan1/level_up_exercises/labels{/name}","releases_url":"https://api.github.com/repos/rkannan1/level_up_exercises/releases{/id}","created_at":"2014-08-18T22:18:29Z","updated_at":"2014-08-21T16:05:41Z","pushed_at":"2014-09-26T19:19:59Z","git_url":"git://github.com/rkannan1/level_up_exercises.git","ssh_url":"git@github.com:rkannan1/level_up_exercises.git","clone_url":"https://github.com/rkannan1/level_up_exercises.git","svn_url":"https://github.com/rkannan1/level_up_exercises","homepage":null,"size":345,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"jmmastey:master","ref":"master","sha":"552accc53ca2c7cc388735353652362c50fb0033","user":{"login":"jmmastey","id":302011,"avatar_url":"https://avatars.githubusercontent.com/u/302011?v=2","gravatar_id":"","url":"https://api.github.com/users/jmmastey","html_url":"https://github.com/jmmastey","followers_url":"https://api.github.com/users/jmmastey/followers","following_url":"https://api.github.com/users/jmmastey/following{/other_user}","gists_url":"https://api.github.com/users/jmmastey/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmastey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmastey/subscriptions","organizations_url":"https://api.github.com/users/jmmastey/orgs","repos_url":"https://api.github.com/users/jmmastey/repos","events_url":"https://api.github.com/users/jmmastey/events{/privacy}","received_events_url":"https://api.github.com/users/jmmastey/received_events","type":"User","site_admin":false},"repo":{"id":20705648,"name":"level_up_exercises","full_name":"jmmastey/level_up_exercises","owner":{"login":"jmmastey","id":302011,"avatar_url":"https://avatars.githubusercontent.com/u/302011?v=2","gravatar_id":"","url":"https://api.github.com/users/jmmastey","html_url":"https://github.com/jmmastey","followers_url":"https://api.github.com/users/jmmastey/followers","following_url":"https://api.github.com/users/jmmastey/following{/other_user}","gists_url":"https://api.github.com/users/jmmastey/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmastey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmastey/subscriptions","organizations_url":"https://api.github.com/users/jmmastey/orgs","repos_url":"https://api.github.com/users/jmmastey/repos","events_url":"https://api.github.com/users/jmmastey/events{/privacy}","received_events_url":"https://api.github.com/users/jmmastey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmmastey/level_up_exercises","description":"A series of code-related assignments to challenge starting engineers","fork":false,"url":"https://api.github.com/repos/jmmastey/level_up_exercises","forks_url":"https://api.github.com/repos/jmmastey/level_up_exercises/forks","keys_url":"https://api.github.com/repos/jmmastey/level_up_exercises/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmmastey/level_up_exercises/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmmastey/level_up_exercises/teams","hooks_url":"https://api.github.com/repos/jmmastey/level_up_exercises/hooks","issue_events_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/events{/number}","events_url":"https://api.github.com/repos/jmmastey/level_up_exercises/events","assignees_url":"https://api.github.com/repos/jmmastey/level_up_exercises/assignees{/user}","branches_url":"https://api.github.com/repos/jmmastey/level_up_exercises/branches{/branch}","tags_url":"https://api.github.com/repos/jmmastey/level_up_exercises/tags","blobs_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmmastey/level_up_exercises/statuses/{sha}","languages_url":"https://api.github.com/repos/jmmastey/level_up_exercises/languages","stargazers_url":"https://api.github.com/repos/jmmastey/level_up_exercises/stargazers","contributors_url":"https://api.github.com/repos/jmmastey/level_up_exercises/contributors","subscribers_url":"https://api.github.com/repos/jmmastey/level_up_exercises/subscribers","subscription_url":"https://api.github.com/repos/jmmastey/level_up_exercises/subscription","commits_url":"https://api.github.com/repos/jmmastey/level_up_exercises/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmmastey/level_up_exercises/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/comments/{number}","contents_url":"https://api.github.com/repos/jmmastey/level_up_exercises/contents/{+path}","compare_url":"https://api.github.com/repos/jmmastey/level_up_exercises/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmmastey/level_up_exercises/merges","archive_url":"https://api.github.com/repos/jmmastey/level_up_exercises/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmmastey/level_up_exercises/downloads","issues_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues{/number}","pulls_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls{/number}","milestones_url":"https://api.github.com/repos/jmmastey/level_up_exercises/milestones{/number}","notifications_url":"https://api.github.com/repos/jmmastey/level_up_exercises/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmmastey/level_up_exercises/labels{/name}","releases_url":"https://api.github.com/repos/jmmastey/level_up_exercises/releases{/id}","created_at":"2014-06-10T23:42:24Z","updated_at":"2014-09-25T17:08:09Z","pushed_at":"2014-09-26T18:33:08Z","git_url":"git://github.com/jmmastey/level_up_exercises.git","ssh_url":"git@github.com:jmmastey/level_up_exercises.git","clone_url":"https://github.com/jmmastey/level_up_exercises.git","svn_url":"https://github.com/jmmastey/level_up_exercises","homepage":"http://leveluprails.herokuapp.com","size":6812,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":11,"forks":29,"open_issues":11,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97"},"html":{"href":"https://github.com/jmmastey/level_up_exercises/pull/97"},"issue":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/97"},"comments":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/statuses/0896aa3d4fb3db1d5cd88b213b6fdbe7f80765c2"}}}}