github_api 0.12.3 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -11
- data/lib/github_api/client/issues/labels.rb +1 -1
- data/lib/github_api/client/repos/collaborators.rb +1 -1
- data/lib/github_api/client/repos/contents.rb +2 -1
- data/lib/github_api/request.rb +1 -0
- data/lib/github_api/utils/url.rb +2 -0
- data/lib/github_api/version.rb +1 -1
- metadata +11 -689
- data/Rakefile +0 -27
- data/features/README.rdoc +0 -30
- data/features/activity/events.feature +0 -73
- data/features/activity/notifications.feature +0 -15
- data/features/activity/starring.feature +0 -50
- data/features/activity/watching.feature +0 -74
- data/features/arguments_parsing.feature +0 -35
- data/features/auto_pagination.feature +0 -39
- data/features/cassettes/activity/events/issue.json +0 -1
- data/features/cassettes/activity/events/network.json +0 -1
- data/features/cassettes/activity/events/org.json +0 -1
- data/features/cassettes/activity/events/performed.json +0 -1
- data/features/cassettes/activity/events/public.json +0 -1
- data/features/cassettes/activity/events/received.json +0 -1
- data/features/cassettes/activity/events/repo.json +0 -1
- data/features/cassettes/activity/notifications/list_user.json +0 -1
- data/features/cassettes/activity/starring/list.json +0 -1
- data/features/cassettes/activity/starring/star.json +0 -1
- data/features/cassettes/activity/starring/starred.json +0 -1
- data/features/cassettes/activity/starring/starring.json +0 -1
- data/features/cassettes/activity/starring/unstar.json +0 -1
- data/features/cassettes/activity/watching/create.json +0 -1
- data/features/cassettes/activity/watching/delete.json +0 -1
- data/features/cassettes/activity/watching/list.json +0 -1
- data/features/cassettes/activity/watching/subscribed.json +0 -1
- data/features/cassettes/activity/watching/unwatch.json +0 -1
- data/features/cassettes/activity/watching/watch.json +0 -1
- data/features/cassettes/activity/watching/watched.json +0 -1
- data/features/cassettes/activity/watching/watching.json +0 -1
- data/features/cassettes/arguments/orgs/get.json +0 -1
- data/features/cassettes/arguments/pulls/get.json +0 -1
- data/features/cassettes/arguments/repo_commits/get.json +0 -1
- data/features/cassettes/auto_pagination/repos/get.json +0 -1
- data/features/cassettes/auto_pagination/repos/global_list.json +0 -1
- data/features/cassettes/auto_pagination/repos/list.json +0 -1
- data/features/cassettes/emojis/list.json +0 -1
- data/features/cassettes/errors/repos/create.json +0 -1
- data/features/cassettes/gists/comments/all.json +0 -1
- data/features/cassettes/gists/comments/first.json +0 -1
- data/features/cassettes/gists/fork.json +0 -1
- data/features/cassettes/gists/gist.json +0 -1
- data/features/cassettes/gists/gists/commits.json +0 -1
- data/features/cassettes/gists/gists/forks.json +0 -1
- data/features/cassettes/gists/gists/public_all.json +0 -1
- data/features/cassettes/gists/gists/starred.json +0 -1
- data/features/cassettes/gists/gists/user_all.json +0 -1
- data/features/cassettes/gists/star.json +0 -1
- data/features/cassettes/gists/starred.json +0 -1
- data/features/cassettes/gists/unstar.json +0 -1
- data/features/cassettes/git_data/commits/get.json +0 -1
- data/features/cassettes/git_data/references/all.json +0 -1
- data/features/cassettes/git_data/references/all_tags.json +0 -1
- data/features/cassettes/git_data/references/one.json +0 -1
- data/features/cassettes/gitignore/get.json +0 -1
- data/features/cassettes/gitignore/get_raw.json +0 -1
- data/features/cassettes/gitignore/list.json +0 -1
- data/features/cassettes/issues/assignees/ckeck.json +0 -1
- data/features/cassettes/issues/assignees/ckeck_not.json +0 -1
- data/features/cassettes/issues/assignees/list.json +0 -1
- data/features/cassettes/issues/comments/create.json +0 -1
- data/features/cassettes/issues/comments/delete.json +0 -1
- data/features/cassettes/issues/comments/edit.json +0 -1
- data/features/cassettes/issues/comments/get.json +0 -1
- data/features/cassettes/issues/comments/list_issue.json +0 -1
- data/features/cassettes/issues/comments/list_repo.json +0 -1
- data/features/cassettes/issues/create.json +0 -1
- data/features/cassettes/issues/edit.json +0 -1
- data/features/cassettes/issues/events/get.json +0 -1
- data/features/cassettes/issues/events/list_issue.json +0 -1
- data/features/cassettes/issues/events/list_repo.json +0 -1
- data/features/cassettes/issues/get.json +0 -1
- data/features/cassettes/issues/labels/add.json +0 -1
- data/features/cassettes/issues/labels/create.json +0 -1
- data/features/cassettes/issues/labels/delete.json +0 -1
- data/features/cassettes/issues/labels/get.json +0 -1
- data/features/cassettes/issues/labels/list_issue.json +0 -1
- data/features/cassettes/issues/labels/list_milestone.json +0 -1
- data/features/cassettes/issues/labels/list_repo.json +0 -1
- data/features/cassettes/issues/labels/remove_all.json +0 -1
- data/features/cassettes/issues/labels/remove_one.json +0 -1
- data/features/cassettes/issues/labels/replace.json +0 -1
- data/features/cassettes/issues/labels/update.json +0 -1
- data/features/cassettes/issues/list/repo.json +0 -1
- data/features/cassettes/issues/list/user.json +0 -1
- data/features/cassettes/issues/milestones/create.json +0 -1
- data/features/cassettes/issues/milestones/delete.json +0 -1
- data/features/cassettes/issues/milestones/get.json +0 -1
- data/features/cassettes/issues/milestones/list.json +0 -1
- data/features/cassettes/issues/milestones/update.json +0 -1
- data/features/cassettes/markdown/render.json +0 -1
- data/features/cassettes/markdown/render_raw.json +0 -1
- data/features/cassettes/media/get_default.json +0 -1
- data/features/cassettes/media/get_full_json.json +0 -1
- data/features/cassettes/media/get_html_json.json +0 -1
- data/features/cassettes/media/get_raw_json.json +0 -1
- data/features/cassettes/media/get_text_json.json +0 -1
- data/features/cassettes/meta/get.json +0 -1
- data/features/cassettes/orgs/get.json +0 -1
- data/features/cassettes/orgs/list/oauth_user.json +0 -1
- data/features/cassettes/orgs/list/user.json +0 -1
- data/features/cassettes/orgs/members/list.json +0 -1
- data/features/cassettes/orgs/members/list_public.json +0 -1
- data/features/cassettes/orgs/members/member_false.json +0 -1
- data/features/cassettes/orgs/members/member_public_false.json +0 -1
- data/features/cassettes/orgs/members/member_public_true.json +0 -1
- data/features/cassettes/pagination/issues/list/first.json +0 -1
- data/features/cassettes/pagination/issues/list/last.json +0 -1
- data/features/cassettes/pagination/issues/list/lastest.json +0 -1
- data/features/cassettes/pagination/issues/list/next.json +0 -1
- data/features/cassettes/pagination/issues/list/prev.json +0 -1
- data/features/cassettes/pagination/repos/commits/list.json +0 -1
- data/features/cassettes/pagination/repos/commits/next.json +0 -1
- data/features/cassettes/pagination/repos/commits/sha.json +0 -1
- data/features/cassettes/pagination/repos/commits/sha/next.json +0 -1
- data/features/cassettes/pagination/repos/diff.json +0 -1
- data/features/cassettes/pagination/repos/diff/next.json +0 -1
- data/features/cassettes/pagination/repos/list.json +0 -1
- data/features/cassettes/pagination/repos/list/next.json +0 -1
- data/features/cassettes/pagination/repos/per_page/each_page.json +0 -1
- data/features/cassettes/pagination/repos/per_page/first.json +0 -1
- data/features/cassettes/pull_requests/comments/list_pull.json +0 -1
- data/features/cassettes/pull_requests/comments/list_repo.json +0 -1
- data/features/cassettes/pull_requests/create.json +0 -1
- data/features/cassettes/pull_requests/get.json +0 -1
- data/features/cassettes/pull_requests/list.json +0 -1
- data/features/cassettes/pull_requests/merge.json +0 -1
- data/features/cassettes/pull_requests/merged.json +0 -1
- data/features/cassettes/ratelimit/get.json +0 -1
- data/features/cassettes/ratelimit/get_remaining.json +0 -1
- data/features/cassettes/ratelimit/get_reset.json +0 -1
- data/features/cassettes/repos/assets/delete.json +0 -1
- data/features/cassettes/repos/assets/edit.json +0 -1
- data/features/cassettes/repos/assets/get.json +0 -1
- data/features/cassettes/repos/assets/list.json +0 -1
- data/features/cassettes/repos/assets/upload.json +0 -1
- data/features/cassettes/repos/branch.json +0 -1
- data/features/cassettes/repos/branch_mutation_one.json +0 -1
- data/features/cassettes/repos/branch_mutation_two.json +0 -1
- data/features/cassettes/repos/branches.json +0 -1
- data/features/cassettes/repos/comments/list.json +0 -1
- data/features/cassettes/repos/commits/compare.json +0 -1
- data/features/cassettes/repos/commits/get.json +0 -1
- data/features/cassettes/repos/commits/list.json +0 -1
- data/features/cassettes/repos/contents/archive.json +0 -1
- data/features/cassettes/repos/contents/create.json +0 -1
- data/features/cassettes/repos/contents/delete.json +0 -1
- data/features/cassettes/repos/contents/get.json +0 -1
- data/features/cassettes/repos/contents/readme.json +0 -1
- data/features/cassettes/repos/contents/update.json +0 -1
- data/features/cassettes/repos/create.json +0 -1
- data/features/cassettes/repos/deployments/create.json +0 -1
- data/features/cassettes/repos/deployments/create_status.json +0 -1
- data/features/cassettes/repos/deployments/list.json +0 -1
- data/features/cassettes/repos/deployments/list_statuses.json +0 -1
- data/features/cassettes/repos/forks/list.json +0 -1
- data/features/cassettes/repos/forks/list_sort.json +0 -1
- data/features/cassettes/repos/get.json +0 -1
- data/features/cassettes/repos/languages.json +0 -1
- data/features/cassettes/repos/list.json +0 -1
- data/features/cassettes/repos/list_org.json +0 -1
- data/features/cassettes/repos/list_org_instance.json +0 -1
- data/features/cassettes/repos/list_repos.json +0 -1
- data/features/cassettes/repos/pages/get.json +0 -1
- data/features/cassettes/repos/pages/list_builds.json +0 -1
- data/features/cassettes/repos/releases/create.json +0 -1
- data/features/cassettes/repos/releases/delete.json +0 -1
- data/features/cassettes/repos/releases/edit.json +0 -1
- data/features/cassettes/repos/releases/get.json +0 -1
- data/features/cassettes/repos/releases/list.json +0 -1
- data/features/cassettes/repos/stats/commits.json +0 -1
- data/features/cassettes/repos/stats/contribs.json +0 -1
- data/features/cassettes/repos/stats/frequency.json +0 -1
- data/features/cassettes/repos/stats/participation.json +0 -1
- data/features/cassettes/repos/stats/punch.json +0 -1
- data/features/cassettes/repos/statuses/list.json +0 -1
- data/features/cassettes/repos/statuses/list_combined.json +0 -1
- data/features/cassettes/repos/tags.json +0 -1
- data/features/cassettes/say/custom.json +0 -1
- data/features/cassettes/say/random.json +0 -1
- data/features/cassettes/search/code.json +0 -1
- data/features/cassettes/search/code_query.json +0 -1
- data/features/cassettes/search/code_unicode.json +0 -1
- data/features/cassettes/search/issues.json +0 -1
- data/features/cassettes/search/legacy/email.json +0 -1
- data/features/cassettes/search/legacy/issues.json +0 -1
- data/features/cassettes/search/legacy/repos.json +0 -1
- data/features/cassettes/search/legacy/users.json +0 -1
- data/features/cassettes/search/legacy/users_keyword.json +0 -1
- data/features/cassettes/search/repos.json +0 -1
- data/features/cassettes/search/users.json +0 -1
- data/features/cassettes/search/users_keyword.json +0 -1
- data/features/cassettes/users/all.json +0 -1
- data/features/cassettes/users/emails/add.json +0 -1
- data/features/cassettes/users/emails/all.json +0 -1
- data/features/cassettes/users/emails/delete.json +0 -1
- data/features/cassettes/users/followers/follow.json +0 -1
- data/features/cassettes/users/followers/following.json +0 -1
- data/features/cassettes/users/followers/following_.json +0 -1
- data/features/cassettes/users/followers/following_another.json +0 -1
- data/features/cassettes/users/followers/list.json +0 -1
- data/features/cassettes/users/followers/unfollow.json +0 -1
- data/features/cassettes/users/get/oauth.json +0 -1
- data/features/cassettes/users/get/oauth.yml +0 -61
- data/features/cassettes/users/get/user.json +0 -1
- data/features/cassettes/users/get/user.yml +0 -62
- data/features/cassettes/users/keys/create.json +0 -1
- data/features/cassettes/users/keys/delete.json +0 -1
- data/features/cassettes/users/keys/user.json +0 -1
- data/features/cassettes/users/keys/user.yml +0 -64
- data/features/cassettes/users/keys/user_all.json +0 -1
- data/features/cassettes/users/keys/user_all.yml +0 -91
- data/features/emojis.feature +0 -12
- data/features/error_codes.feature +0 -14
- data/features/gists.feature +0 -94
- data/features/gists/comments.feature +0 -25
- data/features/git_data/commmits.feature +0 -14
- data/features/git_data/references.feature +0 -49
- data/features/github_api.feature +0 -61
- data/features/gitignore.feature +0 -37
- data/features/issues.feature +0 -64
- data/features/issues/assignees.feature +0 -30
- data/features/issues/comments.feature +0 -72
- data/features/issues/events.feature +0 -38
- data/features/issues/labels.feature +0 -123
- data/features/issues/milestones.feature +0 -62
- data/features/markdown.feature +0 -25
- data/features/media_type.feature +0 -76
- data/features/meta.feature +0 -12
- data/features/options.feature +0 -4
- data/features/orgs.feature +0 -32
- data/features/orgs/members.feature +0 -57
- data/features/pagination.feature +0 -167
- data/features/pull_requests.feature +0 -62
- data/features/pull_requests/comments.feature +0 -27
- data/features/rate_limit.feature +0 -22
- data/features/repos.feature +0 -123
- data/features/repos/assets.feature +0 -59
- data/features/repos/comments.feature +0 -14
- data/features/repos/commits.feature +0 -35
- data/features/repos/contents.feature +0 -74
- data/features/repos/deployments.feature +0 -50
- data/features/repos/forks.feature +0 -28
- data/features/repos/pages.feature +0 -24
- data/features/repos/releases.feature +0 -58
- data/features/repos/statistics.feature +0 -60
- data/features/repos/statuses.feature +0 -40
- data/features/say.feature +0 -68
- data/features/search.feature +0 -82
- data/features/search/legacy.feature +0 -59
- data/features/settings.yml +0 -7
- data/features/settings.yml.sample +0 -7
- data/features/step_definitions/common_steps.rb +0 -104
- data/features/step_definitions/github_api_steps.rb +0 -104
- data/features/support/env.rb +0 -21
- data/features/support/helpers.rb +0 -11
- data/features/support/settings.rb +0 -11
- data/features/support/vcr.rb +0 -21
- data/features/users.feature +0 -31
- data/features/users/emails.feature +0 -40
- data/features/users/followers.feature +0 -63
- data/features/users/keys.feature +0 -48
- data/spec/README.rdoc +0 -26
- data/spec/coverage_adapter.rb +0 -16
- data/spec/fixtures/activity/notifications.json +0 -32
- data/spec/fixtures/activity/subscribed.json +0 -8
- data/spec/fixtures/activity/threads.json +0 -32
- data/spec/fixtures/auths/authorization.json +0 -14
- data/spec/fixtures/auths/authorizations.json +0 -16
- data/spec/fixtures/auths/check.json +0 -36
- data/spec/fixtures/events/events.json +0 -29
- data/spec/fixtures/gists/comment.json +0 -13
- data/spec/fixtures/gists/comments.json +0 -15
- data/spec/fixtures/gists/gist.json +0 -58
- data/spec/fixtures/gists/gists.json +0 -28
- data/spec/fixtures/git_data/blob.json +0 -4
- data/spec/fixtures/git_data/blob_sha.json +0 -3
- data/spec/fixtures/git_data/commit.json +0 -25
- data/spec/fixtures/git_data/reference.json +0 -11
- data/spec/fixtures/git_data/references.json +0 -29
- data/spec/fixtures/git_data/tag.json +0 -16
- data/spec/fixtures/git_data/tree.json +0 -29
- data/spec/fixtures/gitignore/template.json +0 -4
- data/spec/fixtures/gitignore/template_raw +0 -1
- data/spec/fixtures/gitignore/templates.json +0 -9
- data/spec/fixtures/issues/comment.json +0 -13
- data/spec/fixtures/issues/comments.json +0 -15
- data/spec/fixtures/issues/event.json +0 -13
- data/spec/fixtures/issues/events.json +0 -15
- data/spec/fixtures/issues/issue.json +0 -56
- data/spec/fixtures/issues/issues.json +0 -58
- data/spec/fixtures/issues/label.json +0 -5
- data/spec/fixtures/issues/labels.json +0 -7
- data/spec/fixtures/issues/milestone.json +0 -18
- data/spec/fixtures/issues/milestones.json +0 -20
- data/spec/fixtures/orgs/members.json +0 -9
- data/spec/fixtures/orgs/org.json +0 -18
- data/spec/fixtures/orgs/orgs.json +0 -8
- data/spec/fixtures/orgs/team.json +0 -8
- data/spec/fixtures/orgs/team_repos.json +0 -29
- data/spec/fixtures/orgs/teams.json +0 -7
- data/spec/fixtures/pull_requests/comment.json +0 -17
- data/spec/fixtures/pull_requests/comments.json +0 -19
- data/spec/fixtures/pull_requests/commits.json +0 -27
- data/spec/fixtures/pull_requests/files.json +0 -13
- data/spec/fixtures/pull_requests/merge_failure.json +0 -5
- data/spec/fixtures/pull_requests/merge_success.json +0 -5
- data/spec/fixtures/pull_requests/pull_request.json +0 -123
- data/spec/fixtures/pull_requests/pull_requests.json +0 -31
- data/spec/fixtures/repos/asset.json +0 -12
- data/spec/fixtures/repos/assets.json +0 -14
- data/spec/fixtures/repos/assignees.json +0 -9
- data/spec/fixtures/repos/branch.json +0 -53
- data/spec/fixtures/repos/branches.json +0 -9
- data/spec/fixtures/repos/collaborators.json +0 -8
- data/spec/fixtures/repos/commit.json +0 -53
- data/spec/fixtures/repos/commit_activity.json +0 -15
- data/spec/fixtures/repos/commit_comment.json +0 -16
- data/spec/fixtures/repos/commit_comments.json +0 -18
- data/spec/fixtures/repos/commit_comparison.json +0 -112
- data/spec/fixtures/repos/commits.json +0 -27
- data/spec/fixtures/repos/content.json +0 -14
- data/spec/fixtures/repos/content_created.json +0 -44
- data/spec/fixtures/repos/content_deleted.json +0 -30
- data/spec/fixtures/repos/contribs.json +0 -20
- data/spec/fixtures/repos/contributors.json +0 -8
- data/spec/fixtures/repos/deployment.json +0 -31
- data/spec/fixtures/repos/deployment_status.json +0 -33
- data/spec/fixtures/repos/deployment_statuses.json +0 -68
- data/spec/fixtures/repos/deployments.json +0 -33
- data/spec/fixtures/repos/download.json +0 -10
- data/spec/fixtures/repos/download_s3.json +0 -21
- data/spec/fixtures/repos/downloads.json +0 -12
- data/spec/fixtures/repos/fork.json +0 -27
- data/spec/fixtures/repos/forks.json +0 -29
- data/spec/fixtures/repos/frequency.json +0 -7
- data/spec/fixtures/repos/hook.json +0 -15
- data/spec/fixtures/repos/hooks.json +0 -10
- data/spec/fixtures/repos/key.json +0 -6
- data/spec/fixtures/repos/keys.json +0 -8
- data/spec/fixtures/repos/languages.json +0 -4
- data/spec/fixtures/repos/merge.json +0 -48
- data/spec/fixtures/repos/participation.json +0 -110
- data/spec/fixtures/repos/punch_card.json +0 -17
- data/spec/fixtures/repos/readme.json +0 -14
- data/spec/fixtures/repos/release.json +0 -15
- data/spec/fixtures/repos/releases.json +0 -17
- data/spec/fixtures/repos/repo.json +0 -90
- data/spec/fixtures/repos/repo_comments.json +0 -18
- data/spec/fixtures/repos/repos.json +0 -29
- data/spec/fixtures/repos/repos_sorted_by_pushed.json +0 -56
- data/spec/fixtures/repos/stargazers.json +0 -9
- data/spec/fixtures/repos/starred.json +0 -34
- data/spec/fixtures/repos/status.json +0 -16
- data/spec/fixtures/repos/statuses.json +0 -18
- data/spec/fixtures/repos/tags.json +0 -11
- data/spec/fixtures/repos/teams.json +0 -7
- data/spec/fixtures/repos/watched.json +0 -29
- data/spec/fixtures/repos/watchers.json +0 -8
- data/spec/fixtures/search/code.json +0 -76
- data/spec/fixtures/search/email.json +0 -22
- data/spec/fixtures/search/issues.json +0 -54
- data/spec/fixtures/search/issues_legacy.json +0 -23
- data/spec/fixtures/search/repos.json +0 -39
- data/spec/fixtures/search/repos_legacy.json +0 -29
- data/spec/fixtures/search/users.json +0 -20
- data/spec/fixtures/search/users_legacy.json +0 -24
- data/spec/fixtures/users/emails.json +0 -4
- data/spec/fixtures/users/followers.json +0 -9
- data/spec/fixtures/users/key.json +0 -6
- data/spec/fixtures/users/keys.json +0 -8
- data/spec/fixtures/users/user.json +0 -32
- data/spec/fixtures/users/users.json +0 -9
- data/spec/github/api/actions_spec.rb +0 -19
- data/spec/github/api/arguments/dsl_spec.rb +0 -10
- data/spec/github/api/arguments/parse_spec.rb +0 -88
- data/spec/github/api/callbacks_spec.rb +0 -59
- data/spec/github/api/namespace_spec.rb +0 -41
- data/spec/github/api/property_spec.rb +0 -100
- data/spec/github/api/set_spec.rb +0 -32
- data/spec/github/api/with_spec.rb +0 -27
- data/spec/github/api_factory_spec.rb +0 -30
- data/spec/github/api_spec.rb +0 -39
- data/spec/github/authorization_spec.rb +0 -163
- data/spec/github/client/activity/events/issue_spec.rb +0 -51
- data/spec/github/client/activity/events/network_spec.rb +0 -49
- data/spec/github/client/activity/events/org_spec.rb +0 -50
- data/spec/github/client/activity/events/performed_spec.rb +0 -73
- data/spec/github/client/activity/events/public_spec.rb +0 -44
- data/spec/github/client/activity/events/received_spec.rb +0 -72
- data/spec/github/client/activity/events/repository_spec.rb +0 -53
- data/spec/github/client/activity/events/user_org_spec.rb +0 -53
- data/spec/github/client/activity/notifications/create_spec.rb +0 -44
- data/spec/github/client/activity/notifications/delete_spec.rb +0 -41
- data/spec/github/client/activity/notifications/get_spec.rb +0 -58
- data/spec/github/client/activity/notifications/list_spec.rb +0 -75
- data/spec/github/client/activity/notifications/mark_spec.rb +0 -74
- data/spec/github/client/activity/notifications/subscribed_spec.rb +0 -48
- data/spec/github/client/activity/starring/list_spec.rb +0 -53
- data/spec/github/client/activity/starring/star_spec.rb +0 -36
- data/spec/github/client/activity/starring/starred_spec.rb +0 -53
- data/spec/github/client/activity/starring/starring_spec.rb +0 -38
- data/spec/github/client/activity/starring/unstar_spec.rb +0 -37
- data/spec/github/client/activity/watching/list_spec.rb +0 -47
- data/spec/github/client/activity/watching/unwatch_spec.rb +0 -37
- data/spec/github/client/activity/watching/watch_spec.rb +0 -37
- data/spec/github/client/activity/watching/watched_spec.rb +0 -53
- data/spec/github/client/activity/watching/watching_spec.rb +0 -39
- data/spec/github/client/authorizations/app/check_spec.rb +0 -68
- data/spec/github/client/authorizations/app/create_spec.rb +0 -44
- data/spec/github/client/authorizations/app/delete_spec.rb +0 -59
- data/spec/github/client/authorizations/create_spec.rb +0 -49
- data/spec/github/client/authorizations/delete_spec.rb +0 -38
- data/spec/github/client/authorizations/get_spec.rb +0 -48
- data/spec/github/client/authorizations/list_spec.rb +0 -54
- data/spec/github/client/authorizations/two_factor_spec.rb +0 -22
- data/spec/github/client/authorizations/update_spec.rb +0 -49
- data/spec/github/client/gists/comments/create_spec.rb +0 -51
- data/spec/github/client/gists/comments/delete_spec.rb +0 -32
- data/spec/github/client/gists/comments/edit_spec.rb +0 -52
- data/spec/github/client/gists/comments/get_spec.rb +0 -48
- data/spec/github/client/gists/comments/list_spec.rb +0 -51
- data/spec/github/client/gists/comments_spec.rb +0 -11
- data/spec/github/client/gists/create_spec.rb +0 -64
- data/spec/github/client/gists/delete_spec.rb +0 -31
- data/spec/github/client/gists/edit_spec.rb +0 -60
- data/spec/github/client/gists/fork_spec.rb +0 -41
- data/spec/github/client/gists/get_spec.rb +0 -47
- data/spec/github/client/gists/is_starred_spec.rb +0 -44
- data/spec/github/client/gists/list_spec.rb +0 -78
- data/spec/github/client/gists/star_spec.rb +0 -30
- data/spec/github/client/gists/starred_spec.rb +0 -44
- data/spec/github/client/gists/unstar_spec.rb +0 -30
- data/spec/github/client/git_data/blobs/create_spec.rb +0 -64
- data/spec/github/client/git_data/blobs/get_spec.rb +0 -49
- data/spec/github/client/git_data/blobs_spec.rb +0 -9
- data/spec/github/client/git_data/commits/create_spec.rb +0 -77
- data/spec/github/client/git_data/commits/get_spec.rb +0 -50
- data/spec/github/client/git_data/commits_spec.rb +0 -9
- data/spec/github/client/git_data/references/create_spec.rb +0 -67
- data/spec/github/client/git_data/references/delete_spec.rb +0 -39
- data/spec/github/client/git_data/references/get_spec.rb +0 -56
- data/spec/github/client/git_data/references/list_spec.rb +0 -111
- data/spec/github/client/git_data/references/update_spec.rb +0 -62
- data/spec/github/client/git_data/references_spec.rb +0 -11
- data/spec/github/client/git_data/tags/create_spec.rb +0 -63
- data/spec/github/client/git_data/tags/get_spec.rb +0 -48
- data/spec/github/client/git_data/tags_spec.rb +0 -9
- data/spec/github/client/git_data/trees/create_spec.rb +0 -68
- data/spec/github/client/git_data/trees/get_spec.rb +0 -69
- data/spec/github/client/git_data/trees_spec.rb +0 -9
- data/spec/github/client/gitignore/get_spec.rb +0 -53
- data/spec/github/client/gitignore/list_spec.rb +0 -41
- data/spec/github/client/issues/assignees/check_spec.rb +0 -46
- data/spec/github/client/issues/assignees/list_spec.rb +0 -47
- data/spec/github/client/issues/assignees_spec.rb +0 -5
- data/spec/github/client/issues/comments/create_spec.rb +0 -49
- data/spec/github/client/issues/comments/delete_spec.rb +0 -35
- data/spec/github/client/issues/comments/edit_spec.rb +0 -49
- data/spec/github/client/issues/comments/get_spec.rb +0 -48
- data/spec/github/client/issues/comments/list_spec.rb +0 -78
- data/spec/github/client/issues/comments_spec.rb +0 -9
- data/spec/github/client/issues/create_spec.rb +0 -60
- data/spec/github/client/issues/edit_spec.rb +0 -61
- data/spec/github/client/issues/events/get_spec.rb +0 -50
- data/spec/github/client/issues/events/list_spec.rb +0 -85
- data/spec/github/client/issues/events_spec.rb +0 -7
- data/spec/github/client/issues/get_spec.rb +0 -48
- data/spec/github/client/issues/labels/add_spec.rb +0 -50
- data/spec/github/client/issues/labels/create_spec.rb +0 -59
- data/spec/github/client/issues/labels/delete_spec.rb +0 -38
- data/spec/github/client/issues/labels/get_spec.rb +0 -47
- data/spec/github/client/issues/labels/list_spec.rb +0 -102
- data/spec/github/client/issues/labels/remove_spec.rb +0 -57
- data/spec/github/client/issues/labels/replace_spec.rb +0 -48
- data/spec/github/client/issues/labels/update_spec.rb +0 -60
- data/spec/github/client/issues/labels_spec.rb +0 -9
- data/spec/github/client/issues/list_spec.rb +0 -100
- data/spec/github/client/issues/milestones/create_spec.rb +0 -56
- data/spec/github/client/issues/milestones/delete_spec.rb +0 -41
- data/spec/github/client/issues/milestones/get_spec.rb +0 -51
- data/spec/github/client/issues/milestones/list_spec.rb +0 -52
- data/spec/github/client/issues/milestones/update_spec.rb +0 -56
- data/spec/github/client/issues/milestones_spec.rb +0 -11
- data/spec/github/client/orgs/edit_spec.rb +0 -53
- data/spec/github/client/orgs/get_spec.rb +0 -43
- data/spec/github/client/orgs/list_spec.rb +0 -62
- data/spec/github/client/orgs/members/conceal_spec.rb +0 -36
- data/spec/github/client/orgs/members/delete_spec.rb +0 -34
- data/spec/github/client/orgs/members/list_spec.rb +0 -82
- data/spec/github/client/orgs/members/member_spec.rb +0 -66
- data/spec/github/client/orgs/members/publicize_spec.rb +0 -36
- data/spec/github/client/orgs/members_spec.rb +0 -5
- data/spec/github/client/orgs/teams/add_member_spec.rb +0 -40
- data/spec/github/client/orgs/teams/add_repo_spec.rb +0 -39
- data/spec/github/client/orgs/teams/create_spec.rb +0 -58
- data/spec/github/client/orgs/teams/delete_spec.rb +0 -35
- data/spec/github/client/orgs/teams/edit_spec.rb +0 -57
- data/spec/github/client/orgs/teams/get_spec.rb +0 -44
- data/spec/github/client/orgs/teams/list_members_spec.rb +0 -49
- data/spec/github/client/orgs/teams/list_repos_spec.rb +0 -49
- data/spec/github/client/orgs/teams/list_spec.rb +0 -72
- data/spec/github/client/orgs/teams/remove_member_spec.rb +0 -39
- data/spec/github/client/orgs/teams/remove_repo_spec.rb +0 -39
- data/spec/github/client/orgs/teams/team_member_spec.rb +0 -41
- data/spec/github/client/orgs/teams/team_repo_spec.rb +0 -42
- data/spec/github/client/orgs/teams_spec.rb +0 -7
- data/spec/github/client/pull_requests/comments/create_spec.rb +0 -58
- data/spec/github/client/pull_requests/comments/delete_spec.rb +0 -35
- data/spec/github/client/pull_requests/comments/edit_spec.rb +0 -50
- data/spec/github/client/pull_requests/comments/get_spec.rb +0 -51
- data/spec/github/client/pull_requests/comments/list_spec.rb +0 -76
- data/spec/github/client/pull_requests/comments_spec.rb +0 -11
- data/spec/github/client/pull_requests/commits_spec.rb +0 -50
- data/spec/github/client/pull_requests/create_spec.rb +0 -55
- data/spec/github/client/pull_requests/files_spec.rb +0 -50
- data/spec/github/client/pull_requests/get_spec.rb +0 -48
- data/spec/github/client/pull_requests/list_spec.rb +0 -53
- data/spec/github/client/pull_requests/merge_spec.rb +0 -44
- data/spec/github/client/pull_requests/merged_spec.rb +0 -38
- data/spec/github/client/pull_requests/update_spec.rb +0 -55
- data/spec/github/client/repos/assets/delete_spec.rb +0 -39
- data/spec/github/client/repos/assets/edit_spec.rb +0 -40
- data/spec/github/client/repos/assets/get_spec.rb +0 -44
- data/spec/github/client/repos/assets/list_spec.rb +0 -54
- data/spec/github/client/repos/assets/upload_spec.rb +0 -43
- data/spec/github/client/repos/branch_spec.rb +0 -41
- data/spec/github/client/repos/branches_spec.rb +0 -53
- data/spec/github/client/repos/collaborators/add_spec.rb +0 -38
- data/spec/github/client/repos/collaborators/get_spec.rb +0 -49
- data/spec/github/client/repos/collaborators/list_spec.rb +0 -54
- data/spec/github/client/repos/collaborators/remove_spec.rb +0 -38
- data/spec/github/client/repos/collaborators_spec.rb +0 -7
- data/spec/github/client/repos/comments/create_spec.rb +0 -59
- data/spec/github/client/repos/comments/delete_spec.rb +0 -42
- data/spec/github/client/repos/comments/get_spec.rb +0 -51
- data/spec/github/client/repos/comments/list_spec.rb +0 -94
- data/spec/github/client/repos/comments/update_spec.rb +0 -47
- data/spec/github/client/repos/commits/compare_spec.rb +0 -36
- data/spec/github/client/repos/commits/get_spec.rb +0 -49
- data/spec/github/client/repos/commits/list_spec.rb +0 -51
- data/spec/github/client/repos/contents/archive_spec.rb +0 -38
- data/spec/github/client/repos/contents/create_spec.rb +0 -41
- data/spec/github/client/repos/contents/delete_spec.rb +0 -55
- data/spec/github/client/repos/contents/get_spec.rb +0 -35
- data/spec/github/client/repos/contents/readme_spec.rb +0 -30
- data/spec/github/client/repos/contributors_spec.rb +0 -58
- data/spec/github/client/repos/create_spec.rb +0 -77
- data/spec/github/client/repos/delete_spec.rb +0 -37
- data/spec/github/client/repos/deployments/create_spec.rb +0 -54
- data/spec/github/client/repos/deployments/create_status_spec.rb +0 -54
- data/spec/github/client/repos/deployments/list_spec.rb +0 -51
- data/spec/github/client/repos/deployments/statuses_spec.rb +0 -49
- data/spec/github/client/repos/downloads/delete_spec.rb +0 -44
- data/spec/github/client/repos/downloads/get_spec.rb +0 -52
- data/spec/github/client/repos/downloads/list_spec.rb +0 -54
- data/spec/github/client/repos/downloads_spec.rb +0 -13
- data/spec/github/client/repos/edit_spec.rb +0 -59
- data/spec/github/client/repos/forks/create_spec.rb +0 -44
- data/spec/github/client/repos/forks/list_spec.rb +0 -53
- data/spec/github/client/repos/get_spec.rb +0 -50
- data/spec/github/client/repos/hooks/create_spec.rb +0 -67
- data/spec/github/client/repos/hooks/delete_spec.rb +0 -39
- data/spec/github/client/repos/hooks/edit_spec.rb +0 -76
- data/spec/github/client/repos/hooks/get_spec.rb +0 -48
- data/spec/github/client/repos/hooks/list_spec.rb +0 -53
- data/spec/github/client/repos/hooks/ping_spec.rb +0 -39
- data/spec/github/client/repos/hooks/test_spec.rb +0 -39
- data/spec/github/client/repos/hooks_spec.rb +0 -13
- data/spec/github/client/repos/keys/create_spec.rb +0 -49
- data/spec/github/client/repos/keys/delete_spec.rb +0 -39
- data/spec/github/client/repos/keys/get_spec.rb +0 -44
- data/spec/github/client/repos/keys/list_spec.rb +0 -53
- data/spec/github/client/repos/keys_spec.rb +0 -9
- data/spec/github/client/repos/languages_spec.rb +0 -61
- data/spec/github/client/repos/list_spec.rb +0 -120
- data/spec/github/client/repos/merging/merge_spec.rb +0 -59
- data/spec/github/client/repos/pub_sub_hubbub/subscribe_service_spec.rb +0 -26
- data/spec/github/client/repos/pub_sub_hubbub/subscribe_spec.rb +0 -46
- data/spec/github/client/repos/pub_sub_hubbub/unsubscribe_service_spec.rb +0 -20
- data/spec/github/client/repos/pub_sub_hubbub/unsubscribe_spec.rb +0 -58
- data/spec/github/client/repos/releases/create_spec.rb +0 -43
- data/spec/github/client/repos/releases/delete_spec.rb +0 -39
- data/spec/github/client/repos/releases/edit_spec.rb +0 -39
- data/spec/github/client/repos/releases/get_spec.rb +0 -44
- data/spec/github/client/repos/releases/list_spec.rb +0 -53
- data/spec/github/client/repos/statistics/code_frequency_spec.rb +0 -25
- data/spec/github/client/repos/statistics/commit_activity_spec.rb +0 -29
- data/spec/github/client/repos/statistics/contributors_spec.rb +0 -29
- data/spec/github/client/repos/statistics/participation_spec.rb +0 -25
- data/spec/github/client/repos/statistics/punch_card_spec.rb +0 -25
- data/spec/github/client/repos/statuses/create_spec.rb +0 -56
- data/spec/github/client/repos/statuses/list_spec.rb +0 -53
- data/spec/github/client/repos/statuses_spec.rb +0 -11
- data/spec/github/client/repos/tags_spec.rb +0 -59
- data/spec/github/client/repos/teams_spec.rb +0 -59
- data/spec/github/client/scopes/list_spec.rb +0 -33
- data/spec/github/client/search/code_spec.rb +0 -38
- data/spec/github/client/search/issues_spec.rb +0 -38
- data/spec/github/client/search/legacy/email_spec.rb +0 -34
- data/spec/github/client/search/legacy/issues_spec.rb +0 -39
- data/spec/github/client/search/legacy/repos_spec.rb +0 -36
- data/spec/github/client/search/legacy/users_spec.rb +0 -36
- data/spec/github/client/search/repos_spec.rb +0 -38
- data/spec/github/client/search/users_spec.rb +0 -38
- data/spec/github/client/users/emails/add_spec.rb +0 -33
- data/spec/github/client/users/emails/delete_spec.rb +0 -33
- data/spec/github/client/users/emails/list_spec.rb +0 -52
- data/spec/github/client/users/followers/follow_spec.rb +0 -33
- data/spec/github/client/users/followers/following_spec.rb +0 -65
- data/spec/github/client/users/followers/is_following_spec.rb +0 -41
- data/spec/github/client/users/followers/list_spec.rb +0 -62
- data/spec/github/client/users/followers/unfollow_spec.rb +0 -33
- data/spec/github/client/users/get_spec.rb +0 -61
- data/spec/github/client/users/keys/create_spec.rb +0 -51
- data/spec/github/client/users/keys/delete_spec.rb +0 -37
- data/spec/github/client/users/keys/get_spec.rb +0 -50
- data/spec/github/client/users/keys/list_spec.rb +0 -77
- data/spec/github/client/users/keys/update_spec.rb +0 -56
- data/spec/github/client/users/list_spec.rb +0 -45
- data/spec/github/client/users/update_spec.rb +0 -56
- data/spec/github/client_spec.rb +0 -33
- data/spec/github/configuration_spec.rb +0 -56
- data/spec/github/configure_spec.rb +0 -15
- data/spec/github/core_ext/deep_merge_spec.rb +0 -23
- data/spec/github/core_ext/hash_spec.rb +0 -76
- data/spec/github/deprecation_spec.rb +0 -32
- data/spec/github/error/client_error_spec.rb +0 -50
- data/spec/github/error/invalid_options_spec.rb +0 -21
- data/spec/github/error/required_params_spec.rb +0 -21
- data/spec/github/error/service_error/parse_body_spec.rb +0 -38
- data/spec/github/error/service_error/parse_response_spec.rb +0 -38
- data/spec/github/error/service_error_spec.rb +0 -43
- data/spec/github/error/unknown_media_spec.rb +0 -21
- data/spec/github/error/unknown_value_spec.rb +0 -21
- data/spec/github/error/validations_spec.rb +0 -21
- data/spec/github/mime_type_spec.rb +0 -41
- data/spec/github/normalizer_spec.rb +0 -34
- data/spec/github/page_links_spec.rb +0 -35
- data/spec/github/paged_request_spec.rb +0 -45
- data/spec/github/pagination/iterator/number_spec.rb +0 -123
- data/spec/github/pagination/iterator/sha_spec.rb +0 -66
- data/spec/github/parameter_filter_spec.rb +0 -34
- data/spec/github/params_hash_spec.rb +0 -97
- data/spec/github/request/endpoint_spec.rb +0 -22
- data/spec/github/request/jsonize_spec.rb +0 -89
- data/spec/github/request/oauth2_spec.rb +0 -72
- data/spec/github/request/request_spec.rb +0 -36
- data/spec/github/request_spec.rb +0 -41
- data/spec/github/response_wrapper/eql_spec.rb +0 -92
- data/spec/github/response_wrapper/headers_spec.rb +0 -40
- data/spec/github/response_wrapper/overwrites_spec.rb +0 -19
- data/spec/github/response_wrapper_spec.rb +0 -104
- data/spec/github/stack_spec.rb +0 -26
- data/spec/github/utils/url_spec.rb +0 -50
- data/spec/github/validations/format_spec.rb +0 -42
- data/spec/github/validations/presence_spec.rb +0 -34
- data/spec/github/validations/required_spec.rb +0 -28
- data/spec/github/validations/token_spec.rb +0 -19
- data/spec/github/validations_spec.rb +0 -25
- data/spec/github_spec.rb +0 -12
- data/spec/integration/activity_spec.rb +0 -18
- data/spec/integration/arguments_spec.rb +0 -74
- data/spec/integration/authorizations_spec.rb +0 -11
- data/spec/integration/gists_spec.rb +0 -13
- data/spec/integration/git_data_spec.rb +0 -19
- data/spec/integration/issues_spec.rb +0 -21
- data/spec/integration/multiple_invocations_spec.rb +0 -42
- data/spec/integration/options_spec.rb +0 -116
- data/spec/integration/orgs_spec.rb +0 -15
- data/spec/integration/pull_requests_spec.rb +0 -13
- data/spec/integration/repos_spec.rb +0 -37
- data/spec/integration/search_spec.rb +0 -12
- data/spec/integration/users_spec.rb +0 -16
- data/spec/shared/api_interface_behaviour.rb +0 -15
- data/spec/shared/array_of_resources_behaviour.rb +0 -15
- data/spec/shared/request_failure_behaviour.rb +0 -16
- data/spec/spec_helper.rb +0 -101
- data/spec/support/authentication.rb +0 -9
- data/spec/support/base.rb +0 -24
- data/spec/support/file_ops.rb +0 -14
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
require 'github_api/core_ext/hash'
|
|
5
|
-
|
|
6
|
-
describe Github::Normalizer, '#normalize!' do
|
|
7
|
-
let(:hash) { { 'a' => { :b => { 'c' => 1 }, 'd' => [ 'a', { :e => 2 }] } } }
|
|
8
|
-
|
|
9
|
-
let(:klass) {
|
|
10
|
-
Class.new do
|
|
11
|
-
include Github::Normalizer
|
|
12
|
-
end
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
subject(:instance) { klass.new }
|
|
16
|
-
|
|
17
|
-
context '#normalize!' do
|
|
18
|
-
it 'converts hash keys to string' do
|
|
19
|
-
['a', 'b', 'c'].each do |key|
|
|
20
|
-
expect(subject.normalize!(hash).deep_key?(key)).to be_true
|
|
21
|
-
end
|
|
22
|
-
[:a, :b, :c].each do |key|
|
|
23
|
-
expect(subject.normalize!(hash).deep_key?(key)).to be_false
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it "should stringify all the keys inside nested hash" do
|
|
28
|
-
actual = subject.normalize! hash
|
|
29
|
-
expected = { 'a' => { 'b'=> { 'c' => 1 }, 'd' => [ 'a', { 'e'=> 2 }] } }
|
|
30
|
-
actual.should be_eql expected
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end # Github::Normalizer
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
describe Github::PageLinks do
|
|
6
|
-
let(:link) {
|
|
7
|
-
"<https://api.github.com/users/wycats/repos?page=4&per_page=20>; rel=\"next\", <https://api.github.com/users/wycats/repos?page=6&per_page=20>; rel=\"last\", <https://api.github.com/users/wycats/repos?page=1&per_page=20>; rel=\"first\", <https://api.github.com/users/wycats/repos?page=2&per_page=20>; rel=\"prev\""
|
|
8
|
-
}
|
|
9
|
-
let(:response_headers) { { 'Link' => link } }
|
|
10
|
-
|
|
11
|
-
let(:first) { "https://api.github.com/users/wycats/repos?page=1&per_page=20" }
|
|
12
|
-
let(:last) { "https://api.github.com/users/wycats/repos?page=6&per_page=20" }
|
|
13
|
-
let(:prev) { "https://api.github.com/users/wycats/repos?page=2&per_page=20" }
|
|
14
|
-
let(:nexxt) { "https://api.github.com/users/wycats/repos?page=4&per_page=20" }
|
|
15
|
-
|
|
16
|
-
context 'build page links instance' do
|
|
17
|
-
|
|
18
|
-
it 'parses first link successfully' do
|
|
19
|
-
Github::PageLinks.new(response_headers).first.should eql first
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'parses last link successfully' do
|
|
23
|
-
Github::PageLinks.new(response_headers).last.should eql last
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'parses next link successfully' do
|
|
27
|
-
Github::PageLinks.new(response_headers).next.should eql nexxt
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'parses prev link successfully' do
|
|
31
|
-
Github::PageLinks.new(response_headers).prev.should eql prev
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
end # Github::PageLinks
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
describe Github::PagedRequest, '#page_request' do
|
|
6
|
-
let(:current_api) { Github::Client::Repos.new }
|
|
7
|
-
let(:path) { "/repositories/"}
|
|
8
|
-
let(:klass) {
|
|
9
|
-
klass = Class.new do
|
|
10
|
-
include Github::PagedRequest
|
|
11
|
-
end
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
subject(:instance) { klass.new }
|
|
15
|
-
|
|
16
|
-
before {
|
|
17
|
-
instance.stub(:current_api).and_return current_api
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
it { klass.constants.should include :FIRST_PAGE }
|
|
21
|
-
|
|
22
|
-
it { klass.constants.should include :PER_PAGE }
|
|
23
|
-
|
|
24
|
-
it { klass.constants.should include :NOT_FOUND }
|
|
25
|
-
|
|
26
|
-
it { should respond_to(:page_request) }
|
|
27
|
-
|
|
28
|
-
it 'calls get_request on api current instance' do
|
|
29
|
-
current_api.should_receive(:get_request).with(path, {})
|
|
30
|
-
instance.page_request(path)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it 'sets default per_page when only custom page passed' do
|
|
34
|
-
current_api.should_receive(:get_request).
|
|
35
|
-
with(path, {'page' => 3, 'per_page' => 30})
|
|
36
|
-
instance.page_request(path, {'page' => 3, 'per_page' => -1})
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
it 'sets default page when only custom per_page passed' do
|
|
40
|
-
current_api.should_receive(:get_request).
|
|
41
|
-
with(path, {'page' => 1, 'per_page' => 33})
|
|
42
|
-
instance.page_request(path, {'page' => -1, 'per_page' => 33})
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
end # Github::PagedRequest
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
describe Github::PageIterator, 'when number' do
|
|
6
|
-
let(:header) { {
|
|
7
|
-
"Link" => "<https://api.github.com/users/wycats/repos?page=4&per_page=20>; rel=\"next\", <https://api.github.com/users/wycats/repos?page=6&per_page=20>; rel=\"last\", <https://api.github.com/users/wycats/repos?page=1&per_page=20>; rel=\"first\", <https://api.github.com/users/wycats/repos?page=2&per_page=20>; rel=\"prev\""
|
|
8
|
-
} }
|
|
9
|
-
|
|
10
|
-
let(:first_link) { "https://api.github.com/users/wycats/repos?page=1&per_page=20" }
|
|
11
|
-
let(:next_link) { "https://api.github.com/users/wycats/repos?page=4&per_page=20" }
|
|
12
|
-
let(:prev_link) { "https://api.github.com/users/wycats/repos?page=2&per_page=20" }
|
|
13
|
-
let(:last_link) { "https://api.github.com/users/wycats/repos?page=6&per_page=20" }
|
|
14
|
-
|
|
15
|
-
let(:links) { Github::PageLinks.new(header) }
|
|
16
|
-
let(:current_api) { Github::Client::Repos.new }
|
|
17
|
-
let(:user) { 'wycats' }
|
|
18
|
-
let(:response) { double(:response).as_null_object }
|
|
19
|
-
|
|
20
|
-
subject(:iterator) { described_class.new(links, current_api) }
|
|
21
|
-
|
|
22
|
-
before {
|
|
23
|
-
allow(iterator).to receive(:next?).and_return(true)
|
|
24
|
-
stub_get("/users/#{user}/repos").
|
|
25
|
-
with(query: { 'page' => '4', 'per_page' => '20'}).
|
|
26
|
-
to_return(:body => '', :status => 200, :headers => header)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
it { described_class::ATTRIBUTES.should_not be_nil }
|
|
30
|
-
|
|
31
|
-
it { expect(iterator.first_page).to eq(1) }
|
|
32
|
-
|
|
33
|
-
it { expect(iterator.first_page_uri).to eq(first_link) }
|
|
34
|
-
|
|
35
|
-
it { expect(iterator.next_page).to eq(4)}
|
|
36
|
-
|
|
37
|
-
it { expect(iterator.next_page_uri).to eq(next_link) }
|
|
38
|
-
|
|
39
|
-
it { expect(iterator.prev_page).to eq(2)}
|
|
40
|
-
|
|
41
|
-
it { expect(iterator.prev_page_uri).to eq(prev_link) }
|
|
42
|
-
|
|
43
|
-
it { expect(iterator.last_page).to eq(6)}
|
|
44
|
-
|
|
45
|
-
it { expect(iterator.last_page_uri).to eq(last_link) }
|
|
46
|
-
|
|
47
|
-
context 'next?' do
|
|
48
|
-
it "returns true when next_page_uri is present" do
|
|
49
|
-
expect(iterator.next?).to eq(true)
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
context 'first page request' do
|
|
54
|
-
it 'returns nil if there are no more pages' do
|
|
55
|
-
allow(iterator).to receive(:first_page_uri).and_return(false)
|
|
56
|
-
expect(iterator.first).to be_nil
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it 'performs request' do
|
|
60
|
-
expect(iterator).to receive(:page_request).
|
|
61
|
-
with("/users/#{user}/repos", 'per_page' => 20, 'page' => 1).
|
|
62
|
-
and_return(response)
|
|
63
|
-
iterator.first
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
context 'next page request' do
|
|
68
|
-
it 'returns nil if there are no more pages' do
|
|
69
|
-
allow(iterator).to receive(:next?).and_return(false)
|
|
70
|
-
expect(iterator.next).to be_nil
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it 'performs request' do
|
|
74
|
-
expect(iterator).to receive(:page_request).
|
|
75
|
-
with("/users/#{user}/repos", 'page' => 4,'per_page' => 20).
|
|
76
|
-
and_return(response)
|
|
77
|
-
iterator.next
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
context 'prev page request' do
|
|
82
|
-
it 'returns nil if there are no more pages' do
|
|
83
|
-
allow(iterator).to receive(:prev_page_uri).and_return(false)
|
|
84
|
-
expect(iterator.prev).to be_nil
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
it 'performs request' do
|
|
88
|
-
expect(iterator).to receive(:page_request).
|
|
89
|
-
with("/users/#{user}/repos", 'page' => 2,'per_page' => 20).
|
|
90
|
-
and_return(response)
|
|
91
|
-
iterator.prev
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
context 'last page request' do
|
|
96
|
-
it 'returns nil if there are no more pages' do
|
|
97
|
-
allow(iterator).to receive(:last_page_uri).and_return(false)
|
|
98
|
-
expect(iterator.last).to be_nil
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
it 'performs request' do
|
|
102
|
-
expect(iterator).to receive(:page_request).
|
|
103
|
-
with("/users/#{user}/repos", 'page' => 6,'per_page' => 20).
|
|
104
|
-
and_return(response)
|
|
105
|
-
iterator.last
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
context 'get_page request' do
|
|
110
|
-
it 'returns nil if there are no more pages' do
|
|
111
|
-
allow(iterator).to receive(:first_page_uri).and_return(nil)
|
|
112
|
-
allow(iterator).to receive(:last_page_uri).and_return(nil)
|
|
113
|
-
expect(iterator.get_page(5)).to be_nil
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
it 'performs request' do
|
|
117
|
-
expect(iterator).to receive(:page_request).
|
|
118
|
-
with("/users/#{user}/repos", 'page' => 2,'per_page' => 20).
|
|
119
|
-
and_return(response)
|
|
120
|
-
iterator.get_page(2)
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
end
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
describe Github::PageIterator, 'when sha' do
|
|
6
|
-
let(:header) { {"Link" => "<https://api.github.com/repos/peter-murach/github/commits?last_sha=d1e503c02fa770859895dd0d12aedefa28b95723&per_page=30&sha=801d80dfd59bf1d2cb30a243799953ab683a3abd&top=801d80dfd59bf1d2cb30a243799953ab683a3abd>; rel=\"next\", <https://api.github.com/repos/peter-murach/github/commits?per_page=30&sha=801d80dfd59bf1d2cb30a243799953ab683a3abd>; rel=\"first\"" }
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let(:first_link) { "https://api.github.com/repos/peter-murach/github/commits?per_page=30&sha=801d80dfd59bf1d2cb30a243799953ab683a3abd" }
|
|
10
|
-
let(:next_link) { "https://api.github.com/repos/peter-murach/github/commits?last_sha=d1e503c02fa770859895dd0d12aedefa28b95723&per_page=30&sha=801d80dfd59bf1d2cb30a243799953ab683a3abd&top=801d80dfd59bf1d2cb30a243799953ab683a3abd" }
|
|
11
|
-
|
|
12
|
-
let(:top_sha) { '801d80dfd59bf1d2cb30a243799953ab683a3abd' }
|
|
13
|
-
let(:sha) { '801d80dfd59bf1d2cb30a243799953ab683a3abd' }
|
|
14
|
-
let(:last_sha) { "d1e503c02fa770859895dd0d12aedefa28b95723"}
|
|
15
|
-
|
|
16
|
-
let(:links) { Github::PageLinks.new(header) }
|
|
17
|
-
let(:current_api) { Github::Client::Repos.new }
|
|
18
|
-
let(:user) { 'wycats' }
|
|
19
|
-
let(:response) { double(:response).as_null_object }
|
|
20
|
-
|
|
21
|
-
subject(:iterator) { described_class.new(links, current_api) }
|
|
22
|
-
|
|
23
|
-
before {
|
|
24
|
-
allow(iterator).to receive(:next?).and_return(true)
|
|
25
|
-
allow(iterator).to receive(:next_page).and_return(-1)
|
|
26
|
-
stub_get("/repos/peter-murach/github/commits").
|
|
27
|
-
to_return(body: '', status: 200, headers: header)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
it { expect(described_class::ATTRIBUTES).to_not be_nil }
|
|
31
|
-
|
|
32
|
-
it { expect(iterator.first_page).to eq(-1) }
|
|
33
|
-
|
|
34
|
-
it { expect(iterator.first_page_uri).to eq(first_link) }
|
|
35
|
-
|
|
36
|
-
it { expect(iterator.next_page).to eq(-1) }
|
|
37
|
-
|
|
38
|
-
it { expect(iterator.next_page_uri).to eq(next_link) }
|
|
39
|
-
|
|
40
|
-
it { expect(iterator.prev_page).to eq(-1) }
|
|
41
|
-
|
|
42
|
-
it { expect(iterator.prev_page_uri).to be_nil }
|
|
43
|
-
|
|
44
|
-
it { expect(iterator.last_page).to eq(-1) }
|
|
45
|
-
|
|
46
|
-
it { expect(iterator.last_page_uri).to be_nil }
|
|
47
|
-
|
|
48
|
-
context 'first page request' do
|
|
49
|
-
it 'performs request' do
|
|
50
|
-
expect(iterator).to receive(:page_request).
|
|
51
|
-
with("/repos/peter-murach/github/commits",
|
|
52
|
-
'sha' => 'master', 'per_page' => 30).and_return(response)
|
|
53
|
-
iterator.first
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
context 'next page request' do
|
|
58
|
-
it 'performs request' do
|
|
59
|
-
expect(iterator).to receive(:page_request).
|
|
60
|
-
with("/repos/peter-murach/github/commits", 'last_sha' => last_sha,
|
|
61
|
-
'sha' => last_sha, 'per_page' => 30, 'top' => top_sha).
|
|
62
|
-
and_return(response)
|
|
63
|
-
iterator.next
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
require 'github_api/core_ext/hash'
|
|
5
|
-
|
|
6
|
-
describe Github::ParameterFilter, '#filter!' do
|
|
7
|
-
let(:hash) { { :a => { :b => { :c => 1 } } } }
|
|
8
|
-
|
|
9
|
-
let(:klass) {
|
|
10
|
-
Class.new do
|
|
11
|
-
include Github::ParameterFilter
|
|
12
|
-
end
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
subject(:instance) { klass.new }
|
|
16
|
-
|
|
17
|
-
it 'removes unwanted keys from hash' do
|
|
18
|
-
instance.filter!([:a], hash)
|
|
19
|
-
expect(hash.deep_key?(:a)).to be_true
|
|
20
|
-
expect(hash.deep_key?(:b)).to be_false
|
|
21
|
-
expect(hash.deep_key?(:c)).to be_false
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'recursively filters inputs tree' do
|
|
25
|
-
instance.filter!([:a, :b], hash)
|
|
26
|
-
expect(hash.deep_key?(:c)).to be_false
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'filters inputs tree only on top level' do
|
|
30
|
-
instance.filter!([:a, :b], hash, :recursive => false)
|
|
31
|
-
expect(hash.deep_key?(:c)).to be_true
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end # Github::ParameterFilter
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
RSpec.describe Github::ParamsHash do
|
|
6
|
-
let(:object) { described_class }
|
|
7
|
-
|
|
8
|
-
subject(:params) { object.new(hash) }
|
|
9
|
-
|
|
10
|
-
context 'when empty' do
|
|
11
|
-
let(:hash) { {} }
|
|
12
|
-
|
|
13
|
-
it { expect(params.options).to eq({:raw => false}) }
|
|
14
|
-
|
|
15
|
-
it { expect(params.data).to eq({}) }
|
|
16
|
-
|
|
17
|
-
it { expect(params.accept).to eq(nil) }
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
context 'converts key to string' do
|
|
21
|
-
let(:hash) { {foo: 123 } }
|
|
22
|
-
|
|
23
|
-
it { expect(params['foo']).to eql(123) }
|
|
24
|
-
|
|
25
|
-
it { expect(params.data).to eql({"foo" => 123}) }
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
context 'media' do
|
|
29
|
-
let(:hash) { {media: "raw"} }
|
|
30
|
-
|
|
31
|
-
it 'parses media key' do
|
|
32
|
-
expect(params.media).to eql('application/vnd.github.v3.raw+json')
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
context 'with accept' do
|
|
37
|
-
let(:hash) { {accept: "application/json"} }
|
|
38
|
-
|
|
39
|
-
it 'overwrites media key' do
|
|
40
|
-
expect(params.accept).to eql('application/json')
|
|
41
|
-
expect(params.to_hash).to eq({'accept' => 'application/json'})
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
context 'without accept' do
|
|
46
|
-
let(:hash) { {} }
|
|
47
|
-
|
|
48
|
-
it 'overwrites media key' do
|
|
49
|
-
expect(params.accept).to be_nil
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
context 'when data' do
|
|
54
|
-
let(:hash) { {data: 'foobar'} }
|
|
55
|
-
|
|
56
|
-
it 'extracts data key' do
|
|
57
|
-
expect(params.data).to eql('foobar')
|
|
58
|
-
expect(params.to_hash).to eql({'data' => 'foobar'})
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
context 'when content_type' do
|
|
63
|
-
let(:hash) { {content_type: 'application/octet-stream'} }
|
|
64
|
-
|
|
65
|
-
it 'extracts content_type key' do
|
|
66
|
-
expect(params.options[:headers]).to eql(hash)
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
context 'when header' do
|
|
71
|
-
let(:hash) { {headers: {"X-GitHub-OTP" => "<2FA token>"}} }
|
|
72
|
-
|
|
73
|
-
it "sets headers" do
|
|
74
|
-
expect(params.options[:headers]).to eql({"X-GitHub-OTP" => "<2FA token>" })
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
context 'merges defaults' do
|
|
79
|
-
let(:hash) { { :homepage => "https://tty.github.io" }}
|
|
80
|
-
let(:defaults) {
|
|
81
|
-
{ "homepage" => "https://github.com",
|
|
82
|
-
"private" => false}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
it 'correctly updates values' do
|
|
86
|
-
subject.merge_default(defaults)
|
|
87
|
-
expect(params['homepage']).to eql("https://tty.github.io")
|
|
88
|
-
expect(params['private']).to be_false
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
context 'strict encode' do
|
|
93
|
-
let(:hash) { {content: "puts 'hello ruby'"} }
|
|
94
|
-
|
|
95
|
-
it { expect(params.strict_encode64('content')).to eql('cHV0cyAnaGVsbG8gcnVieSc=') }
|
|
96
|
-
end
|
|
97
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
describe Github::API, 'endpoint' do
|
|
6
|
-
let(:endpoint) { "https://my-company/api/v3/" }
|
|
7
|
-
let(:options) { {:endpoint => endpoint } }
|
|
8
|
-
let(:path) { "/repos/GitHub/issues-dev/issues" }
|
|
9
|
-
|
|
10
|
-
subject(:api) { described_class.new(options) }
|
|
11
|
-
|
|
12
|
-
before {
|
|
13
|
-
stub_get(path, 'https://my-company/api/v3').
|
|
14
|
-
to_return(:body => "[]", :status => 200, :headers =>{})
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
its(:endpoint) { should == endpoint }
|
|
18
|
-
|
|
19
|
-
it "doesn't truncate endpoint" do
|
|
20
|
-
expect { api.get_request(path) }.not_to raise_error()
|
|
21
|
-
end
|
|
22
|
-
end
|