octokit 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/octokit/version.rb +1 -1
- data/octokit.gemspec +0 -1
- metadata +5 -682
- data/spec/cassettes/Octokit_Client/_get/handles_query_params.json +0 -1
- data/spec/cassettes/Octokit_Client/_head/handles_query_params.json +0 -1
- data/spec/cassettes/Octokit_Client/_last_response/caches_the_last_agent_response.json +0 -1
- data/spec/cassettes/Octokit_Client/authentication/when_token_authenticated/fetches_and_memoizes_login.json +0 -1
- data/spec/cassettes/Octokit_Client/auto_pagination/fetches_all_the_pages.json +0 -1
- data/spec/cassettes/Octokit_Client/error_handling/raises_on_404.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_authorization/returns_a_single_authorization.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_authorizations/lists_existing_authorizations.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/with_idempotent_true/creates_a_new_authorization_with_options.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/with_idempotent_true/returns_an_existing_API_authorization_if_one_already_exists.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/without_idempotent_true/creates_a_new_API_authorization_each_time.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/without_idempotent_true/creates_a_new_authorization_with_options.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/without_idempotent_true/creates_an_API_authorization.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_a_one-off_token.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_the_current_token.json +0 -1
- data/spec/cassettes/Octokit_Client_Authorizations/_update_authorization/updates_and_existing_authorization.json +0 -1
- data/spec/cassettes/Octokit_Client_CommitComments/_commit_comment/returns_a_single_commit_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_CommitComments/_commit_comments/returns_a_list_of_comments_for_a_specific_commit.json +0 -1
- data/spec/cassettes/Octokit_Client_CommitComments/_create_commit_comment/creates_a_commit_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_CommitComments/_delete_commit_comment/deletes_a_commit_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_CommitComments/_list_commit_comments/returns_a_list_of_all_commit_comments.json +0 -1
- data/spec/cassettes/Octokit_Client_CommitComments/_update_commit_comment/updates_a_commit_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commit/returns_a_commit.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits/handles_branch_or_sha_argument.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits/handles_the_sha_option.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits/returns_all_commits.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_branch_or_sha_argument.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_the_sha_option.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/returns_all_commits_until_the_specified_date.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_branch_or_sha_argument.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_the_sha_option.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/returns_all_commits_until_the_specified_date.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_branch_or_sha_argument.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_the_sha_option.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/returns_all_commits_on_the_specified_date.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_branch_or_sha_argument.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_the_sha_option.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/returns_all_commits_since_the_specified_date.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_compare/returns_a_comparison.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_create_commit/creates_a_commit.json +0 -1
- data/spec/cassettes/Octokit_Client_Commits/_merge/merges_a_branch_into_another.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_archive_link/returns_the_headers_of_the_request.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_contents/returns_the_contents_of_a_file.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_File_object.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_file_path.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_repository_contents_at_a_path.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/does_not_add_new_lines.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_delete_contents/deletes_repository_contents_at_a_path.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_readme/returns_the_default_readme.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_update_contents/does_not_add_new_lines.json +0 -1
- data/spec/cassettes/Octokit_Client_Contents/_update_contents/updates_repository_contents_at_a_path.json +0 -1
- data/spec/cassettes/Octokit_Client_Downloads/_download/gets_a_single_download.json +0 -1
- data/spec/cassettes/Octokit_Client_Downloads/_downloads/lists_available_downloads.json +0 -1
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/creates_a_download_resource.json +0 -1
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/posts_to_an_S3_url.json +0 -1
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_delete_download/deletes_a_download.json +0 -1
- data/spec/cassettes/Octokit_Client_Emojis/_emojis/returns_all_github_emojis.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_issue_event/lists_issue_events_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_issue_events/lists_issue_events_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_organization_events/returns_all_events_for_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_organization_public_events/returns_an_organization_s_public_events.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_public_events/returns_all_public_events.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_received_events/returns_all_user_received_events.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_received_public_events/returns_public_user_received_events.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_repo_issue_events/lists_issue_events_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_repository_events/returns_events_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_repository_network_events/returns_events_for_a_repository_s_network.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_user_events/returns_all_user_events.json +0 -1
- data/spec/cassettes/Octokit_Client_Events/_user_public_events/returns_public_events_performed_by_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gist/returns_the_gist_by_ID.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/with_username_passed/returns_a_list_of_gists.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/without_a_username_passed/returns_a_list_of_gists.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_public_gists/returns_public_gists.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist/creates_a_new_gist.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist_comment/creates_a_gist_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist/deletes_an_existing_gist.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist_comment/deletes_a_gist_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_edit_gist/edit_an_existing_gist.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_fork_gist/forks_an_existing_gist.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comment/returns_a_gist_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comments/returns_the_list_of_gist_comments.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_not_starred.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_starred.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gists/returns_a_list_of_gists.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_star_gist/stars_an_existing_gist.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_starred_gists/returns_the_user_s_starred_gists.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_unstar_gist/unstars_an_existing_gist.json +0 -1
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_update_gist_comment/updates_a_gist_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_template/returns_the_ruby_gitignore_template.json +0 -1
- data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_templates/returns_all_gitignore_templates.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_delimited_labels.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_labels_array.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_issue_comment/returns_a_single_comment_for_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_issue_comments/returns_comments_for_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_dashboard_issues_for_the_authenticated_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_issues_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_org_issues/returns_issues_for_the_organization_for_the_authenticated_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_repository_issues_comments/returns_comments_for_all_issues_in_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/_user_issues/returns_issues_for_the_authenticated_user_for_owned_and_member_repos.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_add_comment/adds_a_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_close_issue/closes_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_a_full_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_reopen_issue/reopens_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_update_issue/updates_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/methods_requiring_a_new_issue_comment/_delete_comment/deletes_an_existing_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/methods_requiring_a_new_issue_comment/_update_comment/updates_an_existing_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_a_color.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_default_color.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/_delete_label_/deletes_a_label_from_the_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/_label/returns_a_single_label.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/_labels/returns_labels.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/_lables_for_milestone/returns_all_labels_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_add_labels_to_an_issue/adds_labels_to_a_given_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_labels_for_issue/returns_all_labels_for_a_given_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_all_labels/removes_all_labels_from_the_specified_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_label/removes_a_label_from_the_specified_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_replace_all_labels/replaces_all_labels_for_an_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_label/_update_label/updates_a_label_with_a_new_color.json +0 -1
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_issues/returns_matching_issues.json +0 -1
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_repos/returns_matching_repositories.json +0 -1
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_users/returns_matching_username.json +0 -1
- data/spec/cassettes/Octokit_Client_Markdown/_markdown/renders_markdown.json +0 -1
- data/spec/cassettes/Octokit_Client_Meta/_github_meta/returns_meta_information_about_github.json +0 -1
- data/spec/cassettes/Octokit_Client_Milestones/_list_milestones/lists_milestones_belonging_to_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_create_milestone/creates_a_milestone.json +0 -1
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_delete_milestone/deletes_a_milestone_from_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_milestone/gets_a_single_milestone_belonging_to_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_update_milestone/updates_a_milestone.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/_mark_notifications_as_read/returns_true_when_notifications_are_marked_as_read.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/_mark_repository_notifications_as_read/returns_true_when_notifications_for_a_repo_are_marked_as_read.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/_notifications/lists_the_notifications_for_the_current_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/_repository_notifications/lists_all_notifications_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_delete_thread_subscription/returns_true_with_successful_thread_deletion.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_mark_thread_as_read/marks_a_thread_as_read.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_notifications/returns_notifications_for_a_specific_thread.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_subscription/returns_a_thread_subscription.json +0 -1
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_update_thread_subscription/updates_a_thread_subscription.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_blob/returns_a_blob.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_create_blob/creates_a_blob.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_create_tag/creates_a_tag.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_create_tree/creates_a_tree.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_tag/returns_a_tag.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree.json +0 -1
- data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree_recursively.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organization/returns_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organization_member_/checks_organization_membership.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organization_members/returns_all_public_members_of_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organization_public_member_/checks_publicized_org_membership.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organization_repositories/returns_all_public_repositories_for_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organization_teams/returns_all_teams_for_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_the_authenticated_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/_update_organization/updates_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_member/adds_a_team_member.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_repository/adds_a_team_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_create_team/creates_a_team.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_delete_team/deletes_a_team.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_publicize_membership/publicizes_membership.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_member/removes_a_team_member.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_repository/removes_a_team_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team/returns_a_team.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_member_/checks_if_a_user_is_member_of_a_team.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_members/returns_team_members.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_repositories/returns_team_repositories.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_unpublicize_membership/unpublicizes_membership.json +0 -1
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_update_team/updates_a_team.json +0 -1
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/raises_an_error_when_topic_is_not_recognized.json +0 -1
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/subscribes_to_pull_events.json +0 -1
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe_service_hook/subscribes_to_pull_events_on_specified_topic.json +0 -1
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_unsubscribe/unsubscribes_from_pull_events.json +0 -1
- data/spec/cassettes/Octokit_Client_PubSubHubbub/unsubscribe_service_hook/unsubscribes_to_stop_receiving_events_on_specified_topic.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_create_pull_request_for_issue/creates_a_pull_request_and_attach_it_to_an_existing_issue.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comment/returns_a_comment_on_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comments/returns_the_comments_for_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_commits/returns_the_commits_for_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_files/lists_files_for_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests/returns_all_pull_requests.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests_comments/returns_all_comments_on_all_pull_requests.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_close_pull_request/closes_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_create_pull_request/creates_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_merge_pull_request/merges_the_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_merged_/returns_whether_the_pull_request_has_been_merged.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_request/returns_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_update_pull_request/updates_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_create_pull_request_comment/creates_a_new_comment_on_a_pull_request.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_create_pull_request_comment_reply/creates_a_new_reply_to_a_pull_request_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_delete_pull_request_comment/deletes_a_pull_request_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_update_pull_request_comment/updates_a_pull_request_comment.json +0 -1
- data/spec/cassettes/Octokit_Client_Refs/_ref/returns_a_tags_ref.json +0 -1
- data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_refs.json +0 -1
- data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_tag_refs.json +0 -1
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_create_ref/creates_a_ref.json +0 -1
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_delete_ref/deletes_an_existing_ref.json +0 -1
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_update_ref/updates_a_ref.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/_create_release/creates_a_release.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/_delete_release/deletes_a_release.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/_release/gets_a_single_release.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/_release_assets/lists_assets_for_a_release.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/_releases/lists_releases_for_a_repo.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/_update_release/updates_a_release.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/handling_release_assets/_release_assets/lists_assets_for_a_release.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/handling_release_assets/_update_release_asset/edits_a_release_asset.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/handling_release_assets/_upload_release_asset/guesses_the_content_type_for_an_asset.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/handling_release_assets/_upload_release_asset/uploads_a_release_asset_as_file_object.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/handling_release_assets/_upload_release_asset/uploads_a_release_asset_by_path.json +0 -1
- data/spec/cassettes/Octokit_Client_Releases/handling_release_assets/_upload_release_asset/uploads_a_release_asset_with_a_default_name.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_all_repositories/returns_all_repositories_on_github.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_assignees/lists_all_the_available_assignees_owner_collaborators_.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_repository_s_branches.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_single_branch.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_check_assignee/checks_to_see_if_a_particular_user_is_an_assignee_for_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_collaborators/returns_a_repository_s_collaborators.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors_excluding_anonymous.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_create_repository/creates_a_repository_for_an_organization.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_delete_subscription/returns_true_when_repo_subscription_deleted.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_fork/forks_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_languages/returns_a_repository_s_languages.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_network/returns_a_repository_s_network.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_a_user_s_repositories.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_authenticated_user_s_repositories.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_repository/returns_the_matching_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_false_if_the_repository_doesn_t_exist.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_true_if_the_repository_exists.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_star/stars_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_stargazers/returns_all_repository_stargazers.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_subscribers/lists_all_the_users_watching_the_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_subscription/returns_a_repository_subscription.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_tags/returns_a_repository_s_tags.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_unstar/unstars_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_unwatch/unwatches_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_update_subscription/updates_a_repository_subscription.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_watch/watches_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/_watchers/returns_all_repository_watchers.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_add_collaborator/adds_a_repository_collaborators.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_create_repository/creates_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_delete_repository/deletes_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_deploy_keys/returns_a_repository_s_deploy_keys.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_hooks/returns_a_repository_s_hooks.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_remove_collaborator/removes_a_repository_collaborators.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_repository_teams/returns_all_repository_teams.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_update_repository/updates_the_matching_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_requiring_an_existing_deploy_key/_add_deploy_key/adds_a_repository_deploy_keys.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_create_hook/creates_a_hook.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_edit_hook/edits_a_hook.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_hook/returns_a_repository_s_single_hook.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_remove_hook/removes_a_hook.json +0 -1
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_test_hook/tests_a_hook.json +0 -1
- data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat.json +0 -1
- data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat_with_custom_text.json +0 -1
- data/spec/cassettes/Octokit_Client_Search/_search_code/searches_code.json +0 -1
- data/spec/cassettes/Octokit_Client_Search/_search_issues/searches_issues.json +0 -1
- data/spec/cassettes/Octokit_Client_Search/_search_repositories/searches_repositories.json +0 -1
- data/spec/cassettes/Octokit_Client_Search/_search_users/searches_users.json +0 -1
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json +0 -1
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +0 -1
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json +0 -1
- data/spec/cassettes/Octokit_Client_Stats/_code_frequency_stats/returns_the_code_frequency_stats.json +0 -1
- data/spec/cassettes/Octokit_Client_Stats/_commit_activity_stats/returns_the_commit_activity_stats.json +0 -1
- data/spec/cassettes/Octokit_Client_Stats/_contributors_stats/returns_contributors_and_their_contribution_stats.json +0 -1
- data/spec/cassettes/Octokit_Client_Stats/_participation_stats/returns_the_owner_and_contributor_participation_stats.json +0 -1
- data/spec/cassettes/Octokit_Client_Stats/_punch_card_stats/returns_commit_count_by_hour_punch_card_stats.json +0 -1
- data/spec/cassettes/Octokit_Client_Statuses/_create_status/creates_status.json +0 -1
- data/spec/cassettes/Octokit_Client_Statuses/_statuses/lists_commit_statuses.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_add_email/adds_an_email_address.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_all_users/returns_all_GitHub_users.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_emails/returns_email_addresses.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_follow/follows_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_followers/returns_followers_for_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_followers/returns_the_authenticated_user_s_followers.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_following/returns_following_for_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_following/returns_the_authenticated_user_s_following.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_given_user_is_following_target_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_the_authenticated_user_follows_another.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_keys/returns_public_keys_for_the_authenticated_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_remove_email/removes_an_email_address.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_the_authenticated_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_starred_/checks_if_the_authenticated_user_has_starred_a_repository.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_starred_/checks_if_the_authenticated_user_has_starred_a_repository_deprecated_.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_a_user_watches_for_notifications.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_the_authenticated_user_watches_for_notifications.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_unfollow/unfollows_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_update_user/updates_a_user_profile.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_user/returns_a_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_user/returns_the_authenticated_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_user_keys/returns_public_keys_for_another_user.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/_validate_credentials/validates_username_and_password.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_add_key/adds_a_public_key.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_key/returns_a_public_key.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_remove_key/removes_a_public_key.json +0 -1
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_update_key/updates_a_public_key.json +0 -1
- data/spec/cassettes/delete_authorization.json +0 -1
- data/spec/cassettes/rate_limit.json +0 -1
- data/spec/cassettes/root.json +0 -1
- data/spec/fixtures/large_file.txt +0 -48
- data/spec/fixtures/new_file.txt +0 -1
- data/spec/fixtures/updated_file.txt +0 -1
- data/spec/fixtures/upload.png +0 -0
- data/spec/fixtures/user.json +0 -31
- data/spec/fixtures/web_flow_token.json +0 -4
- data/spec/helper.rb +0 -133
- data/spec/octokit/client/authorizations_spec.rb +0 -118
- data/spec/octokit/client/commit_comments_spec.rb +0 -62
- data/spec/octokit/client/commits_spec.rb +0 -139
- data/spec/octokit/client/contents_spec.rb +0 -131
- data/spec/octokit/client/downloads_spec.rb +0 -59
- data/spec/octokit/client/emojis_spec.rb +0 -12
- data/spec/octokit/client/events_spec.rb +0 -106
- data/spec/octokit/client/gists_spec.rb +0 -184
- data/spec/octokit/client/gitignore_spec.rb +0 -26
- data/spec/octokit/client/issues_spec.rb +0 -174
- data/spec/octokit/client/labels_spec.rb +0 -115
- data/spec/octokit/client/legacy_search_spec.rb +0 -42
- data/spec/octokit/client/markdown_spec.rb +0 -20
- data/spec/octokit/client/meta_spec.rb +0 -14
- data/spec/octokit/client/milestones_spec.rb +0 -59
- data/spec/octokit/client/notifications_spec.rb +0 -85
- data/spec/octokit/client/objects_spec.rb +0 -71
- data/spec/octokit/client/organizations_spec.rb +0 -197
- data/spec/octokit/client/pub_sub_hubbub_spec.rb +0 -93
- data/spec/octokit/client/pull_requests_spec.rb +0 -186
- data/spec/octokit/client/rate_limit_spec.rb +0 -44
- data/spec/octokit/client/refs_spec.rb +0 -70
- data/spec/octokit/client/releases_spec.rb +0 -137
- data/spec/octokit/client/repositories_spec.rb +0 -406
- data/spec/octokit/client/say_spec.rb +0 -23
- data/spec/octokit/client/search_spec.rb +0 -59
- data/spec/octokit/client/service_status_spec.rb +0 -37
- data/spec/octokit/client/stats_spec.rb +0 -105
- data/spec/octokit/client/statuses_spec.rb +0 -28
- data/spec/octokit/client/users_spec.rb +0 -220
- data/spec/octokit/client_spec.rb +0 -576
- data/spec/octokit/gist_spec.rb +0 -49
- data/spec/octokit/rate_limit_spec.rb +0 -30
- data/spec/octokit/repository_spec.rb +0 -55
- data/spec/octokit_spec.rb +0 -46
data/spec/octokit/client_spec.rb
DELETED
@@ -1,576 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
describe Octokit::Client do
|
5
|
-
|
6
|
-
describe "module configuration" do
|
7
|
-
|
8
|
-
before do
|
9
|
-
Octokit.reset!
|
10
|
-
Octokit.configure do |config|
|
11
|
-
Octokit::Configurable.keys.each do |key|
|
12
|
-
config.send("#{key}=", "Some #{key}")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
after do
|
18
|
-
Octokit.reset!
|
19
|
-
end
|
20
|
-
|
21
|
-
it "inherits the module configuration" do
|
22
|
-
client = Octokit::Client.new
|
23
|
-
Octokit::Configurable.keys.each do |key|
|
24
|
-
expect(client.instance_variable_get(:"@#{key}")).to eq "Some #{key}"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "with class level configuration" do
|
29
|
-
|
30
|
-
before do
|
31
|
-
@opts = {
|
32
|
-
:connection_options => {:ssl => {:verify => false}},
|
33
|
-
:per_page => 40,
|
34
|
-
:login => "defunkt",
|
35
|
-
:password => "il0veruby"
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
|
-
it "overrides module configuration" do
|
40
|
-
client = Octokit::Client.new(@opts)
|
41
|
-
expect(client.per_page).to eq 40
|
42
|
-
expect(client.login).to eq "defunkt"
|
43
|
-
expect(client.instance_variable_get(:"@password")).to eq "il0veruby"
|
44
|
-
expect(client.auto_paginate).to eq Octokit.auto_paginate
|
45
|
-
expect(client.client_id).to eq Octokit.client_id
|
46
|
-
end
|
47
|
-
|
48
|
-
it "can set configuration after initialization" do
|
49
|
-
client = Octokit::Client.new
|
50
|
-
client.configure do |config|
|
51
|
-
@opts.each do |key, value|
|
52
|
-
config.send("#{key}=", value)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
expect(client.per_page).to eq 40
|
56
|
-
expect(client.login).to eq "defunkt"
|
57
|
-
expect(client.instance_variable_get(:"@password")).to eq "il0veruby"
|
58
|
-
expect(client.auto_paginate).to eq Octokit.auto_paginate
|
59
|
-
expect(client.client_id).to eq Octokit.client_id
|
60
|
-
end
|
61
|
-
|
62
|
-
it "masks passwords on inspect" do
|
63
|
-
client = Octokit::Client.new(@opts)
|
64
|
-
inspected = client.inspect
|
65
|
-
expect(inspected).to_not include "il0veruby"
|
66
|
-
end
|
67
|
-
|
68
|
-
it "masks tokens on inspect" do
|
69
|
-
client = Octokit::Client.new(:access_token => '87614b09dd141c22800f96f11737ade5226d7ba8')
|
70
|
-
inspected = client.inspect
|
71
|
-
expect(inspected).to_not match "87614b09dd141c22800f96f11737ade5226d7ba8"
|
72
|
-
end
|
73
|
-
|
74
|
-
it "masks client secrets on inspect" do
|
75
|
-
client = Octokit::Client.new(:client_secret => '87614b09dd141c22800f96f11737ade5226d7ba8')
|
76
|
-
inspected = client.inspect
|
77
|
-
expect(inspected).to_not match "87614b09dd141c22800f96f11737ade5226d7ba8"
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "with .netrc" do
|
81
|
-
it "can read .netrc files" do
|
82
|
-
Octokit.reset!
|
83
|
-
client = Octokit::Client.new \
|
84
|
-
:netrc => true,
|
85
|
-
:netrc_file => File.join(fixture_path, '.netrc')
|
86
|
-
expect(client.login).to eq "sferik"
|
87
|
-
expect(client.instance_variable_get(:"@password")).to eq "il0veruby"
|
88
|
-
end
|
89
|
-
|
90
|
-
it "can read non-standard API endpoint creds from .netrc" do
|
91
|
-
Octokit.reset!
|
92
|
-
client = Octokit::Client.new \
|
93
|
-
:netrc => true,
|
94
|
-
:netrc_file => File.join(fixture_path, '.netrc'),
|
95
|
-
:api_endpoint => 'http://api.github.dev'
|
96
|
-
expect(client.login).to eq "defunkt"
|
97
|
-
expect(client.instance_variable_get(:"@password")).to eq "il0veruby"
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
describe "authentication" do
|
104
|
-
before do
|
105
|
-
Octokit.reset!
|
106
|
-
@client = Octokit.client
|
107
|
-
end
|
108
|
-
|
109
|
-
describe "with module level config" do
|
110
|
-
before do
|
111
|
-
Octokit.reset!
|
112
|
-
end
|
113
|
-
it "sets basic auth creds with .configure" do
|
114
|
-
Octokit.configure do |config|
|
115
|
-
config.login = 'pengwynn'
|
116
|
-
config.password = 'il0veruby'
|
117
|
-
end
|
118
|
-
expect(Octokit.client).to be_basic_authenticated
|
119
|
-
end
|
120
|
-
it "sets basic auth creds with module methods" do
|
121
|
-
Octokit.login = 'pengwynn'
|
122
|
-
Octokit.password = 'il0veruby'
|
123
|
-
expect(Octokit.client).to be_basic_authenticated
|
124
|
-
end
|
125
|
-
it "sets oauth token with .configure" do
|
126
|
-
Octokit.configure do |config|
|
127
|
-
config.access_token = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
128
|
-
end
|
129
|
-
expect(Octokit.client).to_not be_basic_authenticated
|
130
|
-
expect(Octokit.client).to be_token_authenticated
|
131
|
-
end
|
132
|
-
it "sets oauth token with module methods" do
|
133
|
-
Octokit.access_token = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
134
|
-
expect(Octokit.client).to_not be_basic_authenticated
|
135
|
-
expect(Octokit.client).to be_token_authenticated
|
136
|
-
end
|
137
|
-
it "sets oauth application creds with .configure" do
|
138
|
-
Octokit.configure do |config|
|
139
|
-
config.client_id = '97b4937b385eb63d1f46'
|
140
|
-
config.client_secret = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
141
|
-
end
|
142
|
-
expect(Octokit.client).to_not be_basic_authenticated
|
143
|
-
expect(Octokit.client).to_not be_token_authenticated
|
144
|
-
expect(Octokit.client).to be_application_authenticated
|
145
|
-
end
|
146
|
-
it "sets oauth token with module methods" do
|
147
|
-
Octokit.client_id = '97b4937b385eb63d1f46'
|
148
|
-
Octokit.client_secret = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
149
|
-
expect(Octokit.client).to_not be_basic_authenticated
|
150
|
-
expect(Octokit.client).to_not be_token_authenticated
|
151
|
-
expect(Octokit.client).to be_application_authenticated
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
describe "with class level config" do
|
156
|
-
it "sets basic auth creds with .configure" do
|
157
|
-
@client.configure do |config|
|
158
|
-
config.login = 'pengwynn'
|
159
|
-
config.password = 'il0veruby'
|
160
|
-
end
|
161
|
-
expect(@client).to be_basic_authenticated
|
162
|
-
end
|
163
|
-
it "sets basic auth creds with instance methods" do
|
164
|
-
@client.login = 'pengwynn'
|
165
|
-
@client.password = 'il0veruby'
|
166
|
-
expect(@client).to be_basic_authenticated
|
167
|
-
end
|
168
|
-
it "sets oauth token with .configure" do
|
169
|
-
@client.access_token = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
170
|
-
expect(@client).to_not be_basic_authenticated
|
171
|
-
expect(@client).to be_token_authenticated
|
172
|
-
end
|
173
|
-
it "sets oauth token with instance methods" do
|
174
|
-
@client.access_token = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
175
|
-
expect(@client).to_not be_basic_authenticated
|
176
|
-
expect(@client).to be_token_authenticated
|
177
|
-
end
|
178
|
-
it "sets oauth application creds with .configure" do
|
179
|
-
@client.configure do |config|
|
180
|
-
config.client_id = '97b4937b385eb63d1f46'
|
181
|
-
config.client_secret = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
182
|
-
end
|
183
|
-
expect(@client).to_not be_basic_authenticated
|
184
|
-
expect(@client).to_not be_token_authenticated
|
185
|
-
expect(@client).to be_application_authenticated
|
186
|
-
end
|
187
|
-
it "sets oauth token with module methods" do
|
188
|
-
@client.client_id = '97b4937b385eb63d1f46'
|
189
|
-
@client.client_secret = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
190
|
-
expect(@client).to_not be_basic_authenticated
|
191
|
-
expect(@client).to_not be_token_authenticated
|
192
|
-
expect(@client).to be_application_authenticated
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe "when basic authenticated" do
|
197
|
-
it "makes authenticated calls" do
|
198
|
-
Octokit.configure do |config|
|
199
|
-
config.login = 'pengwynn'
|
200
|
-
config.password = 'il0veruby'
|
201
|
-
end
|
202
|
-
|
203
|
-
VCR.turn_off!
|
204
|
-
root_request = stub_get("https://pengwynn:il0veruby@api.github.com/")
|
205
|
-
Octokit.client.get("/")
|
206
|
-
assert_requested root_request
|
207
|
-
VCR.turn_on!
|
208
|
-
end
|
209
|
-
end
|
210
|
-
describe "when token authenticated", :vcr do
|
211
|
-
it "makes authenticated calls" do
|
212
|
-
client = oauth_client
|
213
|
-
|
214
|
-
root_request = stub_get("/").
|
215
|
-
with(:headers => {:authorization => "token #{test_github_token}"})
|
216
|
-
client.get("/")
|
217
|
-
assert_requested root_request
|
218
|
-
end
|
219
|
-
it "fetches and memoizes login" do
|
220
|
-
client = oauth_client
|
221
|
-
|
222
|
-
expect(client.login).to eq test_github_login
|
223
|
-
assert_requested :get, github_url('/user')
|
224
|
-
end
|
225
|
-
end
|
226
|
-
describe "when application authenticated", :vcr do
|
227
|
-
it "makes authenticated calls" do
|
228
|
-
client = Octokit.client
|
229
|
-
client.client_id = '97b4937b385eb63d1f46'
|
230
|
-
client.client_secret = 'd255197b4937b385eb63d1f4677e3ffee61fbaea'
|
231
|
-
|
232
|
-
root_request = stub_get("/?client_id=97b4937b385eb63d1f46&client_secret=d255197b4937b385eb63d1f4677e3ffee61fbaea")
|
233
|
-
client.get("/")
|
234
|
-
assert_requested root_request
|
235
|
-
end
|
236
|
-
end
|
237
|
-
end
|
238
|
-
|
239
|
-
describe ".agent" do
|
240
|
-
before do
|
241
|
-
Octokit.reset!
|
242
|
-
end
|
243
|
-
it "acts like a Sawyer agent" do
|
244
|
-
expect(Octokit.client.agent).to respond_to :start
|
245
|
-
end
|
246
|
-
it "caches the agent" do
|
247
|
-
agent = Octokit.client.agent
|
248
|
-
expect(agent.object_id).to eq Octokit.client.agent.object_id
|
249
|
-
end
|
250
|
-
end # .agent
|
251
|
-
|
252
|
-
describe ".root" do
|
253
|
-
it "fetches the API root" do
|
254
|
-
Octokit.reset!
|
255
|
-
VCR.use_cassette 'root' do
|
256
|
-
root = Octokit.client.root
|
257
|
-
expect(root.rels[:issues].href).to eq "https://api.github.com/issues"
|
258
|
-
end
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
describe ".last_response", :vcr do
|
263
|
-
it "caches the last agent response" do
|
264
|
-
Octokit.reset!
|
265
|
-
client = Octokit.client
|
266
|
-
expect(client.last_response).to be_nil
|
267
|
-
client.get "/"
|
268
|
-
expect(client.last_response.status).to eq 200
|
269
|
-
end
|
270
|
-
end # .last_response
|
271
|
-
|
272
|
-
describe ".get", :vcr do
|
273
|
-
before(:each) do
|
274
|
-
Octokit.reset!
|
275
|
-
end
|
276
|
-
it "handles query params" do
|
277
|
-
Octokit.get "/", :foo => "bar"
|
278
|
-
assert_requested :get, "https://api.github.com?foo=bar"
|
279
|
-
end
|
280
|
-
it "handles headers" do
|
281
|
-
request = stub_get("/zen").
|
282
|
-
with(:query => {:foo => "bar"}, :headers => {:accept => "text/plain"})
|
283
|
-
Octokit.get "/zen", :foo => "bar", :accept => "text/plain"
|
284
|
-
assert_requested request
|
285
|
-
end
|
286
|
-
end # .get
|
287
|
-
|
288
|
-
describe ".head", :vcr do
|
289
|
-
it "handles query params" do
|
290
|
-
Octokit.reset!
|
291
|
-
Octokit.head "/", :foo => "bar"
|
292
|
-
assert_requested :head, "https://api.github.com?foo=bar"
|
293
|
-
end
|
294
|
-
it "handles headers" do
|
295
|
-
Octokit.reset!
|
296
|
-
request = stub_head("/zen").
|
297
|
-
with(:query => {:foo => "bar"}, :headers => {:accept => "text/plain"})
|
298
|
-
Octokit.head "/zen", :foo => "bar", :accept => "text/plain"
|
299
|
-
assert_requested request
|
300
|
-
end
|
301
|
-
end # .head
|
302
|
-
|
303
|
-
describe "when making requests" do
|
304
|
-
before do
|
305
|
-
Octokit.reset!
|
306
|
-
@client = Octokit.client
|
307
|
-
end
|
308
|
-
it "Accepts application/vnd.github.beta+json by default" do
|
309
|
-
VCR.use_cassette 'root' do
|
310
|
-
root_request = stub_get("/").
|
311
|
-
with(:headers => {:accept => "application/vnd.github.beta+json"})
|
312
|
-
@client.get "/"
|
313
|
-
assert_requested root_request
|
314
|
-
expect(@client.last_response.status).to eq 200
|
315
|
-
end
|
316
|
-
end
|
317
|
-
it "allows Accept'ing another media type" do
|
318
|
-
root_request = stub_get("/").
|
319
|
-
with(:headers => {:accept => "application/vnd.github.beta.diff+json"})
|
320
|
-
@client.get "/", :accept => "application/vnd.github.beta.diff+json"
|
321
|
-
assert_requested root_request
|
322
|
-
expect(@client.last_response.status).to eq 200
|
323
|
-
end
|
324
|
-
it "sets a default user agent" do
|
325
|
-
root_request = stub_get("/").
|
326
|
-
with(:headers => {:user_agent => Octokit::Default.user_agent})
|
327
|
-
@client.get "/"
|
328
|
-
assert_requested root_request
|
329
|
-
expect(@client.last_response.status).to eq 200
|
330
|
-
end
|
331
|
-
it "sets a custom user agent" do
|
332
|
-
user_agent = "Mozilla/5.0 I am Spartacus!"
|
333
|
-
root_request = stub_get("/").
|
334
|
-
with(:headers => {:user_agent => user_agent})
|
335
|
-
client = Octokit::Client.new :user_agent => user_agent
|
336
|
-
client.get "/"
|
337
|
-
assert_requested root_request
|
338
|
-
expect(client.last_response.status).to eq 200
|
339
|
-
end
|
340
|
-
it "sets a proxy server" do
|
341
|
-
Octokit.configure do |config|
|
342
|
-
config.proxy = 'http://proxy.example.com:80'
|
343
|
-
end
|
344
|
-
conn = Octokit.client.send(:agent).instance_variable_get(:"@conn")
|
345
|
-
expect(conn.proxy[:uri].to_s).to eq 'http://proxy.example.com'
|
346
|
-
end
|
347
|
-
it "passes along request headers for POST" do
|
348
|
-
VCR.turn_off!
|
349
|
-
headers = {"X-GitHub-Foo" => "bar"}
|
350
|
-
root_request = stub_post("/").
|
351
|
-
with(:headers => headers).
|
352
|
-
to_return(:status => 201)
|
353
|
-
client = Octokit::Client.new
|
354
|
-
client.post "/", :headers => headers
|
355
|
-
assert_requested root_request
|
356
|
-
expect(client.last_response.status).to eq 201
|
357
|
-
VCR.turn_on!
|
358
|
-
end
|
359
|
-
end
|
360
|
-
|
361
|
-
describe "auto pagination", :vcr do
|
362
|
-
before do
|
363
|
-
Octokit.reset!
|
364
|
-
Octokit.configure do |config|
|
365
|
-
config.auto_paginate = true
|
366
|
-
config.per_page = 3
|
367
|
-
end
|
368
|
-
end
|
369
|
-
|
370
|
-
after do
|
371
|
-
Octokit.reset!
|
372
|
-
end
|
373
|
-
|
374
|
-
it "fetches all the pages" do
|
375
|
-
Octokit.client.paginate('/repos/octokit/octokit.rb/issues')
|
376
|
-
assert_requested :get, github_url("/repos/octokit/octokit.rb/issues?per_page=3")
|
377
|
-
(2..7).each do |i|
|
378
|
-
assert_requested :get, github_url("/repositories/417862/issues?per_page=3&page=#{i}")
|
379
|
-
end
|
380
|
-
end
|
381
|
-
end
|
382
|
-
|
383
|
-
context "error handling" do
|
384
|
-
before do
|
385
|
-
Octokit.reset!
|
386
|
-
VCR.turn_off!
|
387
|
-
end
|
388
|
-
|
389
|
-
after do
|
390
|
-
VCR.turn_on!
|
391
|
-
end
|
392
|
-
|
393
|
-
it "raises on 404" do
|
394
|
-
stub_get('/booya').to_return(:status => 404)
|
395
|
-
expect { Octokit.get('/booya') }.to raise_error Octokit::NotFound
|
396
|
-
end
|
397
|
-
|
398
|
-
it "raises on 500" do
|
399
|
-
stub_get('/boom').to_return(:status => 500)
|
400
|
-
expect { Octokit.get('/boom') }.to raise_error Octokit::InternalServerError
|
401
|
-
end
|
402
|
-
|
403
|
-
it "includes a message" do
|
404
|
-
stub_get('/boom').
|
405
|
-
to_return \
|
406
|
-
:status => 422,
|
407
|
-
:headers => {
|
408
|
-
:content_type => "application/json",
|
409
|
-
},
|
410
|
-
:body => {:message => "No repository found for hubtopic"}.to_json
|
411
|
-
begin
|
412
|
-
Octokit.get('/boom')
|
413
|
-
rescue Octokit::UnprocessableEntity => e
|
414
|
-
expect(e.message).to include \
|
415
|
-
"GET https://api.github.com/boom: 422 - No repository found"
|
416
|
-
end
|
417
|
-
end
|
418
|
-
|
419
|
-
it "includes an error" do
|
420
|
-
stub_get('/boom').
|
421
|
-
to_return \
|
422
|
-
:status => 422,
|
423
|
-
:headers => {
|
424
|
-
:content_type => "application/json",
|
425
|
-
},
|
426
|
-
:body => {:error => "No repository found for hubtopic"}.to_json
|
427
|
-
begin
|
428
|
-
Octokit.get('/boom')
|
429
|
-
rescue Octokit::UnprocessableEntity => e
|
430
|
-
expect(e.message).to include \
|
431
|
-
"GET https://api.github.com/boom: 422 - Error: No repository found"
|
432
|
-
end
|
433
|
-
end
|
434
|
-
|
435
|
-
it "includes an error summary" do
|
436
|
-
stub_get('/boom').
|
437
|
-
to_return \
|
438
|
-
:status => 422,
|
439
|
-
:headers => {
|
440
|
-
:content_type => "application/json",
|
441
|
-
},
|
442
|
-
:body => {
|
443
|
-
:message => "Validation Failed",
|
444
|
-
:errors => [
|
445
|
-
:resource => "Issue",
|
446
|
-
:field => "title",
|
447
|
-
:code => "missing_field"
|
448
|
-
]
|
449
|
-
}.to_json
|
450
|
-
begin
|
451
|
-
Octokit.get('/boom')
|
452
|
-
rescue Octokit::UnprocessableEntity => e
|
453
|
-
expect(e.message).to include \
|
454
|
-
"GET https://api.github.com/boom: 422 - Validation Failed"
|
455
|
-
expect(e.message).to include " resource: Issue"
|
456
|
-
expect(e.message).to include " field: title"
|
457
|
-
expect(e.message).to include " code: missing_field"
|
458
|
-
end
|
459
|
-
end
|
460
|
-
|
461
|
-
it "exposes errors array" do
|
462
|
-
stub_get('/boom').
|
463
|
-
to_return \
|
464
|
-
:status => 422,
|
465
|
-
:headers => {
|
466
|
-
:content_type => "application/json",
|
467
|
-
},
|
468
|
-
:body => {
|
469
|
-
:message => "Validation Failed",
|
470
|
-
:errors => [
|
471
|
-
:resource => "Issue",
|
472
|
-
:field => "title",
|
473
|
-
:code => "missing_field"
|
474
|
-
]
|
475
|
-
}.to_json
|
476
|
-
begin
|
477
|
-
Octokit.get('/boom')
|
478
|
-
rescue Octokit::UnprocessableEntity => e
|
479
|
-
expect(e.errors.first[:resource]).to eq("Issue")
|
480
|
-
expect(e.errors.first[:field]).to eq("title")
|
481
|
-
expect(e.errors.first[:code]).to eq("missing_field")
|
482
|
-
end
|
483
|
-
end
|
484
|
-
|
485
|
-
it "knows the difference between Forbidden and rate limiting" do
|
486
|
-
stub_get('/some/admin/stuffs').to_return(:status => 403)
|
487
|
-
expect { Octokit.get('/some/admin/stuffs') }.to raise_error Octokit::Forbidden
|
488
|
-
|
489
|
-
stub_get('/users/mojomobo').to_return \
|
490
|
-
:status => 403,
|
491
|
-
:headers => {
|
492
|
-
:content_type => "application/json",
|
493
|
-
},
|
494
|
-
:body => {:message => "API rate limit exceeded"}.to_json
|
495
|
-
expect { Octokit.get('/users/mojomobo') }.to raise_error Octokit::TooManyRequests
|
496
|
-
|
497
|
-
stub_get('/user').to_return \
|
498
|
-
:status => 403,
|
499
|
-
:headers => {
|
500
|
-
:content_type => "application/json",
|
501
|
-
},
|
502
|
-
:body => {:message => "Maximum number of login attempts exceeded"}.to_json
|
503
|
-
expect { Octokit.get('/user') }.to raise_error Octokit::TooManyLoginAttempts
|
504
|
-
end
|
505
|
-
|
506
|
-
it "raises on unknown client errors" do
|
507
|
-
stub_get('/user').to_return \
|
508
|
-
:status => 418,
|
509
|
-
:headers => {
|
510
|
-
:content_type => "application/json",
|
511
|
-
},
|
512
|
-
:body => {:message => "I'm a teapot"}.to_json
|
513
|
-
expect { Octokit.get('/user') }.to raise_error Octokit::ClientError
|
514
|
-
end
|
515
|
-
|
516
|
-
it "raises on unknown server errors" do
|
517
|
-
stub_get('/user').to_return \
|
518
|
-
:status => 509,
|
519
|
-
:headers => {
|
520
|
-
:content_type => "application/json",
|
521
|
-
},
|
522
|
-
:body => {:message => "Bandwidth exceeded"}.to_json
|
523
|
-
expect { Octokit.get('/user') }.to raise_error Octokit::ServerError
|
524
|
-
end
|
525
|
-
|
526
|
-
it "handles documentation URLs in error messages" do
|
527
|
-
stub_get('/user').to_return \
|
528
|
-
:status => 415,
|
529
|
-
:headers => {
|
530
|
-
:content_type => "application/json",
|
531
|
-
},
|
532
|
-
:body => {
|
533
|
-
:message => "Unsupported Media Type",
|
534
|
-
:documentation_url => "http://developer.github.com/v3"
|
535
|
-
}.to_json
|
536
|
-
begin
|
537
|
-
Octokit.get('/user')
|
538
|
-
rescue Octokit::UnsupportedMediaType => e
|
539
|
-
msg = "415 - Unsupported Media Type"
|
540
|
-
expect(e.message).to include(msg)
|
541
|
-
expect(e.documentation_url).to eq("http://developer.github.com/v3")
|
542
|
-
end
|
543
|
-
end
|
544
|
-
end
|
545
|
-
|
546
|
-
it "knows the difference between unauthorized and needs OTP" do
|
547
|
-
stub_get('/authorizations').to_return(:status => 401)
|
548
|
-
expect { Octokit.get('/authorizations') }.to raise_error Octokit::Unauthorized
|
549
|
-
|
550
|
-
stub_get('/authorizations/1').to_return \
|
551
|
-
:status => 401,
|
552
|
-
:headers => {
|
553
|
-
:content_type => "application/json",
|
554
|
-
"X-GitHub-OTP" => "required; sms"
|
555
|
-
},
|
556
|
-
:body => {:message => "Must specify two-factor authentication OTP code."}.to_json
|
557
|
-
expect { Octokit.get('/authorizations/1') }.to raise_error Octokit::OneTimePasswordRequired
|
558
|
-
end
|
559
|
-
|
560
|
-
it "knows the password delivery mechanism when needs OTP" do
|
561
|
-
stub_get('/authorizations/1').to_return \
|
562
|
-
:status => 401,
|
563
|
-
:headers => {
|
564
|
-
:content_type => "application/json",
|
565
|
-
"X-GitHub-OTP" => "required; app"
|
566
|
-
},
|
567
|
-
:body => {:message => "Must specify two-factor authentication OTP code."}.to_json
|
568
|
-
|
569
|
-
begin
|
570
|
-
Octokit.get('/authorizations/1')
|
571
|
-
rescue Octokit::OneTimePasswordRequired => otp_error
|
572
|
-
expect(otp_error.password_delivery).to eql 'app'
|
573
|
-
end
|
574
|
-
end
|
575
|
-
|
576
|
-
end
|