hub/features
Mislav Marohnić 57b8337db1
Merge pull request #2432 from jfahrer/master
Add the ability to edit issues

Fixes #1686, fixes #1151, ref. #1523
2020-01-21 12:55:00 +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
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
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
fetch.feature Switch to "the output should not contain anything" built-in step 2019-08-21 18:23:50 +02:00
fish_completion.feature
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
issue-transfer.feature [issue] Add `transfer` tests 2019-12-15 20:48:45 +01:00
issue.feature Allow updating issue state 2020-01-21 12:48:56 +01:00
merge.feature
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-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
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 Improve `color.ui` config support 2019-12-03 04:30:34 +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

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.