{"action":"created","comment":{"url":"https://api.github.com/repos/jbender/motion-spec/pulls/comments/44025153","id":44025153,"diff_hunk":"@@ -0,0 +1,128 @@\n+# -*- encoding : utf-8 -*-\n+describe 'Matcher::RaiseError' do\n+  context 'without arguments' do\n+    it 'passes when the block raises any exception' do\n+      expect { 1 / 0 }.to raise_error\n+    end\n+\n+    it \"failes when the block doesn't raise any exception\" do\n+      expect_failure('Block expected to raise error') do\n+        expect { Object.new }.to raise_error\n+      end\n+    end\n+  end\n+\n+  context 'with a class argument' do\n+    it 'passes when the block raises an exception of the argument class' do\n+      expect { 1 / 0 }.to raise_error(ZeroDivisionError)\n+    end\n+\n+    it 'fails when the block raises an exception of a different class' do\n+      expect_failure('Block expected to raise error of type ArgumentError') do\n+        expect { 1 / 0 }.to raise_error(ArgumentError)\n+      end\n+    end\n+\n+    it 'fails when the block raises an exception of the argument class but asked not to' do\n+      expect_failure('Block not expected to raise error of type ZeroDivisionError') do\n+        expect { 1 / 0 }.not_to raise_error(ZeroDivisionError)\n+      end\n+    end\n+  end\n+\n+  context 'with a string argument' do\n+    context 'raised message includes the string' do\n+      it 'passes' do\n+        expect { raise 'one message' }.to raise_error('one message')\n+      end\n+    end\n+\n+    context 'raised message does not include the string' do\n+      it 'fails' do\n+        message =\n+          \"Block expected to raise error with message matching \\\"different\\\" \" \\\n+          \"but was #<RuntimeError: one message>\"\n+\n+        expect_failure(message) do\n+          expect { raise 'one message' }.to raise_error('different')\n+        end\n+      end\n+    end\n+  end\n+\n+  context 'with a regex argument' do\n+    context 'raised message matches the regex' do\n+      it 'passes' do\n+        expect { raise 'one message' }.to raise_error(/message/)\n+      end\n+    end\n+\n+    context 'raised message does not matches the regex' do\n+      it 'fails' do\n+        message =\n+          \"Block expected to raise error with message matching \" \\\n+          \"#{/different/.inspect} but was #<RuntimeError: one message>\"\n+\n+        expect_failure(message) do\n+          expect { raise 'one message' }.to raise_error(/different/)\n+        end\n+      end\n+    end\n+  end\n+\n+  context 'with a class and string arguments' do\n+    it 'passes if the block raises an exception of the same class and includes the string in its message' do\n+      expect { raise ArgumentError.new('with a message') }.to raise_error(ArgumentError, 'message')\n+    end\n+\n+    it \"fails if the block raises an exception of the same class and but doesn't include the string in its message\" do\n+      message =\n+        \"Block expected to raise error of type ArgumentError with message \" \\\n+        \"matching #{'different'.inspect}\"\n+\n+      expect_failure(message) do\n+        expect { raise ArgumentError.new('with a message') }.to raise_error(ArgumentError, 'different')\n+      end\n+    end\n+\n+    it 'fails if the block raises an exception of a different class' do\n+      message =\n+        \"Block expected to raise error of type ZeroDivisionError with message \" \\\n+        \"matching #{'message'.inspect}\"\n+\n+      expect_failure(message) do\n+        expect { raise ArgumentError.new('with a message') }.to raise_error(ZeroDivisionError, 'message')\n+      end\n+    end\n+  end\n+\n+  context 'with a class and regex arguements' do\n+    it 'passes if the block raises an exception of the same class and includes the string in its message' do\n+      expect { raise ArgumentError.new('with a message') }.to raise_error(ArgumentError, /message/)\n+    end\n+\n+    it \"fails if the block raises an exception of the same class and but doesn't include the string in its message\" do\n+      message =\n+        \"Block expected to raise error of type ArgumentError with message \" \\","path":"spec/motion-spec/matchers/raise_error_spec.rb","position":106,"original_position":106,"commit_id":"e4241e431228c43b6398006a949f8854e021ca57","original_commit_id":"e4241e431228c43b6398006a949f8854e021ca57","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","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":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2015-11-05T15:35:14Z","updated_at":"2015-11-05T15:35:14Z","html_url":"https://github.com/jbender/motion-spec/pull/3#discussion_r44025153","pull_request_url":"https://api.github.com/repos/jbender/motion-spec/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/jbender/motion-spec/pulls/comments/44025153"},"html":{"href":"https://github.com/jbender/motion-spec/pull/3#discussion_r44025153"},"pull_request":{"href":"https://api.github.com/repos/jbender/motion-spec/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/jbender/motion-spec/pulls/3","id":49751759,"html_url":"https://github.com/jbender/motion-spec/pull/3","diff_url":"https://github.com/jbender/motion-spec/pull/3.diff","patch_url":"https://github.com/jbender/motion-spec/pull/3.patch","issue_url":"https://api.github.com/repos/jbender/motion-spec/issues/3","number":3,"state":"open","locked":false,"title":"Add `expect` for use over `should`","user":{"login":"jbender","id":723784,"avatar_url":"https://avatars.githubusercontent.com/u/723784?v=3","gravatar_id":"","url":"https://api.github.com/users/jbender","html_url":"https://github.com/jbender","followers_url":"https://api.github.com/users/jbender/followers","following_url":"https://api.github.com/users/jbender/following{/other_user}","gists_url":"https://api.github.com/users/jbender/gists{/gist_id}","starred_url":"https://api.github.com/users/jbender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbender/subscriptions","organizations_url":"https://api.github.com/users/jbender/orgs","repos_url":"https://api.github.com/users/jbender/repos","events_url":"https://api.github.com/users/jbender/events{/privacy}","received_events_url":"https://api.github.com/users/jbender/received_events","type":"User","site_admin":false},"body":"Pretty much a direct import from `bacon-expect` with some modification to work in the new naming scheme/load pattern","created_at":"2015-11-04T21:58:09Z","updated_at":"2015-11-05T15:35:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2430a53eee9bf4c15892e56537e44a790afdf28c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbender/motion-spec/pulls/3/commits","review_comments_url":"https://api.github.com/repos/jbender/motion-spec/pulls/3/comments","review_comment_url":"https://api.github.com/repos/jbender/motion-spec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbender/motion-spec/issues/3/comments","statuses_url":"https://api.github.com/repos/jbender/motion-spec/statuses/e4241e431228c43b6398006a949f8854e021ca57","head":{"label":"jbender:feature/expectations","ref":"feature/expectations","sha":"e4241e431228c43b6398006a949f8854e021ca57","user":{"login":"jbender","id":723784,"avatar_url":"https://avatars.githubusercontent.com/u/723784?v=3","gravatar_id":"","url":"https://api.github.com/users/jbender","html_url":"https://github.com/jbender","followers_url":"https://api.github.com/users/jbender/followers","following_url":"https://api.github.com/users/jbender/following{/other_user}","gists_url":"https://api.github.com/users/jbender/gists{/gist_id}","starred_url":"https://api.github.com/users/jbender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbender/subscriptions","organizations_url":"https://api.github.com/users/jbender/orgs","repos_url":"https://api.github.com/users/jbender/repos","events_url":"https://api.github.com/users/jbender/events{/privacy}","received_events_url":"https://api.github.com/users/jbender/received_events","type":"User","site_admin":false},"repo":{"id":45269421,"name":"motion-spec","full_name":"jbender/motion-spec","owner":{"login":"jbender","id":723784,"avatar_url":"https://avatars.githubusercontent.com/u/723784?v=3","gravatar_id":"","url":"https://api.github.com/users/jbender","html_url":"https://github.com/jbender","followers_url":"https://api.github.com/users/jbender/followers","following_url":"https://api.github.com/users/jbender/following{/other_user}","gists_url":"https://api.github.com/users/jbender/gists{/gist_id}","starred_url":"https://api.github.com/users/jbender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbender/subscriptions","organizations_url":"https://api.github.com/users/jbender/orgs","repos_url":"https://api.github.com/users/jbender/repos","events_url":"https://api.github.com/users/jbender/events{/privacy}","received_events_url":"https://api.github.com/users/jbender/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbender/motion-spec","description":"RubyMotion spec library","fork":false,"url":"https://api.github.com/repos/jbender/motion-spec","forks_url":"https://api.github.com/repos/jbender/motion-spec/forks","keys_url":"https://api.github.com/repos/jbender/motion-spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbender/motion-spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbender/motion-spec/teams","hooks_url":"https://api.github.com/repos/jbender/motion-spec/hooks","issue_events_url":"https://api.github.com/repos/jbender/motion-spec/issues/events{/number}","events_url":"https://api.github.com/repos/jbender/motion-spec/events","assignees_url":"https://api.github.com/repos/jbender/motion-spec/assignees{/user}","branches_url":"https://api.github.com/repos/jbender/motion-spec/branches{/branch}","tags_url":"https://api.github.com/repos/jbender/motion-spec/tags","blobs_url":"https://api.github.com/repos/jbender/motion-spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbender/motion-spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbender/motion-spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbender/motion-spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbender/motion-spec/statuses/{sha}","languages_url":"https://api.github.com/repos/jbender/motion-spec/languages","stargazers_url":"https://api.github.com/repos/jbender/motion-spec/stargazers","contributors_url":"https://api.github.com/repos/jbender/motion-spec/contributors","subscribers_url":"https://api.github.com/repos/jbender/motion-spec/subscribers","subscription_url":"https://api.github.com/repos/jbender/motion-spec/subscription","commits_url":"https://api.github.com/repos/jbender/motion-spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbender/motion-spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbender/motion-spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbender/motion-spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbender/motion-spec/contents/{+path}","compare_url":"https://api.github.com/repos/jbender/motion-spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbender/motion-spec/merges","archive_url":"https://api.github.com/repos/jbender/motion-spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbender/motion-spec/downloads","issues_url":"https://api.github.com/repos/jbender/motion-spec/issues{/number}","pulls_url":"https://api.github.com/repos/jbender/motion-spec/pulls{/number}","milestones_url":"https://api.github.com/repos/jbender/motion-spec/milestones{/number}","notifications_url":"https://api.github.com/repos/jbender/motion-spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbender/motion-spec/labels{/name}","releases_url":"https://api.github.com/repos/jbender/motion-spec/releases{/id}","created_at":"2015-10-30T18:32:59Z","updated_at":"2015-10-30T22:51:25Z","pushed_at":"2015-11-05T15:35:00Z","git_url":"git://github.com/jbender/motion-spec.git","ssh_url":"git@github.com:jbender/motion-spec.git","clone_url":"https://github.com/jbender/motion-spec.git","svn_url":"https://github.com/jbender/motion-spec","homepage":"","size":360,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"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"}},"base":{"label":"jbender:master","ref":"master","sha":"7f8e327a6b5386a85796b4f71205015754b83c7a","user":{"login":"jbender","id":723784,"avatar_url":"https://avatars.githubusercontent.com/u/723784?v=3","gravatar_id":"","url":"https://api.github.com/users/jbender","html_url":"https://github.com/jbender","followers_url":"https://api.github.com/users/jbender/followers","following_url":"https://api.github.com/users/jbender/following{/other_user}","gists_url":"https://api.github.com/users/jbender/gists{/gist_id}","starred_url":"https://api.github.com/users/jbender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbender/subscriptions","organizations_url":"https://api.github.com/users/jbender/orgs","repos_url":"https://api.github.com/users/jbender/repos","events_url":"https://api.github.com/users/jbender/events{/privacy}","received_events_url":"https://api.github.com/users/jbender/received_events","type":"User","site_admin":false},"repo":{"id":45269421,"name":"motion-spec","full_name":"jbender/motion-spec","owner":{"login":"jbender","id":723784,"avatar_url":"https://avatars.githubusercontent.com/u/723784?v=3","gravatar_id":"","url":"https://api.github.com/users/jbender","html_url":"https://github.com/jbender","followers_url":"https://api.github.com/users/jbender/followers","following_url":"https://api.github.com/users/jbender/following{/other_user}","gists_url":"https://api.github.com/users/jbender/gists{/gist_id}","starred_url":"https://api.github.com/users/jbender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbender/subscriptions","organizations_url":"https://api.github.com/users/jbender/orgs","repos_url":"https://api.github.com/users/jbender/repos","events_url":"https://api.github.com/users/jbender/events{/privacy}","received_events_url":"https://api.github.com/users/jbender/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbender/motion-spec","description":"RubyMotion spec library","fork":false,"url":"https://api.github.com/repos/jbender/motion-spec","forks_url":"https://api.github.com/repos/jbender/motion-spec/forks","keys_url":"https://api.github.com/repos/jbender/motion-spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbender/motion-spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbender/motion-spec/teams","hooks_url":"https://api.github.com/repos/jbender/motion-spec/hooks","issue_events_url":"https://api.github.com/repos/jbender/motion-spec/issues/events{/number}","events_url":"https://api.github.com/repos/jbender/motion-spec/events","assignees_url":"https://api.github.com/repos/jbender/motion-spec/assignees{/user}","branches_url":"https://api.github.com/repos/jbender/motion-spec/branches{/branch}","tags_url":"https://api.github.com/repos/jbender/motion-spec/tags","blobs_url":"https://api.github.com/repos/jbender/motion-spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbender/motion-spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbender/motion-spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbender/motion-spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbender/motion-spec/statuses/{sha}","languages_url":"https://api.github.com/repos/jbender/motion-spec/languages","stargazers_url":"https://api.github.com/repos/jbender/motion-spec/stargazers","contributors_url":"https://api.github.com/repos/jbender/motion-spec/contributors","subscribers_url":"https://api.github.com/repos/jbender/motion-spec/subscribers","subscription_url":"https://api.github.com/repos/jbender/motion-spec/subscription","commits_url":"https://api.github.com/repos/jbender/motion-spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbender/motion-spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbender/motion-spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbender/motion-spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbender/motion-spec/contents/{+path}","compare_url":"https://api.github.com/repos/jbender/motion-spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbender/motion-spec/merges","archive_url":"https://api.github.com/repos/jbender/motion-spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbender/motion-spec/downloads","issues_url":"https://api.github.com/repos/jbender/motion-spec/issues{/number}","pulls_url":"https://api.github.com/repos/jbender/motion-spec/pulls{/number}","milestones_url":"https://api.github.com/repos/jbender/motion-spec/milestones{/number}","notifications_url":"https://api.github.com/repos/jbender/motion-spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbender/motion-spec/labels{/name}","releases_url":"https://api.github.com/repos/jbender/motion-spec/releases{/id}","created_at":"2015-10-30T18:32:59Z","updated_at":"2015-10-30T22:51:25Z","pushed_at":"2015-11-05T15:35:00Z","git_url":"git://github.com/jbender/motion-spec.git","ssh_url":"git@github.com:jbender/motion-spec.git","clone_url":"https://github.com/jbender/motion-spec.git","svn_url":"https://github.com/jbender/motion-spec","homepage":"","size":360,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"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/jbender/motion-spec/pulls/3"},"html":{"href":"https://github.com/jbender/motion-spec/pull/3"},"issue":{"href":"https://api.github.com/repos/jbender/motion-spec/issues/3"},"comments":{"href":"https://api.github.com/repos/jbender/motion-spec/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/jbender/motion-spec/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/jbender/motion-spec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbender/motion-spec/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/jbender/motion-spec/statuses/e4241e431228c43b6398006a949f8854e021ca57"}}}}