hub/features
Mislav Marohnić 4b7f6a4f3a Fix git bundle test re: main branch 2020-11-17 11:38:25 +01:00
..
support [issue] Add `transfer` tests 2019-12-15 20:48:45 +01:00
README.md [docs] Improve CONTRIBUTING documentation 2019-10-29 11:47:43 +01:00
alias.feature Add rc alias support 2017-03-02 10:16:24 +09:00
am.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
api.feature Ensure `response.Request` is populated for responses from cache 2020-01-19 15:47:17 +01:00
apply.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
authentication.feature Print token authorization URL on HTTP 403 due to `X-Github-Sso` challenge 2020-01-19 14:58:49 +01:00
bash_completion.feature Update tests to include new bash completion options for git fork 2019-10-03 21:53:57 +02:00
browse.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
checkout.feature [checkout] Avoid overriding existing branch merge config 2019-10-22 17:56:07 +02:00
cherry_pick.feature Simplify cherry-picking commits from pull request URLs 2018-06-14 14:47:27 +02:00
ci_status.feature [ci-status] Add support for `--format` string 2019-01-29 21:54:18 +01:00
clone.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
compare.feature [compare] Allow slash in branch names 2019-10-01 17:07:26 +02:00
create.feature [create] Fix newline in error message 2019-06-06 23:31:03 +02:00
delete.feature Enable `hub delete` on GitHub Enterprise 2018-06-06 14:06:39 +02:00
fetch.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
fish_completion.feature Allow the unsorted expansion for the fish shell 2017-05-09 20:10:57 +09:00
fork.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
gist.feature Detect and report insufficient OAuth scopes leading to 40x response 2020-01-19 14:58:48 +01:00
git_compatibility.feature Make a gist command 2019-09-16 23:55:58 -07:00
help.feature [help] Have `hub <cmd> --help` open the man page 2019-10-31 03:07:47 +01:00
init.feature Support `hub init -g DIR` 2015-02-02 20:56:37 -08:00
issue-transfer.feature [issue] Add `transfer` tests 2019-12-15 20:48:45 +01:00
issue.feature Fix typos 2020-04-26 00:21:34 +02:00
merge.feature Improve `hub merge` to not generate leftover remote refs 2016-09-14 02:41:58 +02:00
pr-checkout.feature [checkout] Make it work independently of remote refspec 2019-02-24 09:58:51 +01:00
pr-list.feature Improve `color.ui` config support 2019-12-03 04:30:34 +01:00
pr-merge.feature Add functionality and tests to `pr merge` 2020-08-02 20:35:50 +02:00
pr-show.feature [pr show] Avoid duplicate API requests 2019-10-08 13:02:35 +02:00
pull_request.feature Refuse to follow HTTP 301, 302 redirects for non-GET requests 2020-01-16 19:40:28 +01:00
push.feature Port `hub push` tests to cukes 2014-07-25 20:38:12 -07:00
release.feature [release] Retry attaching release assets on 5xx server errors 2019-10-30 14:33:33 +01:00
remote_add.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
steps.rb Fix git bundle test re: main branch 2020-11-17 11:38:25 +01:00
submodule_add.feature Fix `submodule add` cukes 2019-08-21 17:29:33 +02:00
sync.feature Add quotes around branch name in warning 2019-08-20 10:48:28 -04:00
zsh_completion.feature Add missing completions and docs for pull-request flags. 2015-08-06 16:21:43 -07:00

README.md

Cucumber features for hub

How to run all features:

make bin/cucumber
bin/cucumber

Because this can take a couple of minutes, you may want to only run select files related to the functionality that you're developing:

bin/cucumber feature/api.feature

The Cucumber test suite requires a Ruby development environment. If you want to avoid setting that up, you can run tests inside a Docker container:

script/docker feature/api.feature

How it works

Each scenario is actually making real invocations to hub on the command-line in the context of a real (dynamically created) git repository.

Whenever a scenario requires talking to the GitHub API, a fake HTTP server is spun locally to replace the real GitHub API. This is done so that the test suite runs faster and is available offline as well. The fake API server is defined as a Sinatra app inline in each scenario:

Given the GitHub API server:
  """
  post('/repos/github/hub/pulls') {
    status 200
  }
  """

How to write new tests

The best way to learn to write new tests is to study the existing scenarios for commands that are similar to those that you want to add or change.

Since Cucumber tests are written in a natural language, you mostly don't need to know Ruby to write new tests.