hub/features
Austin Ziegler c4af574b19
Change default protocol to HTTPS (#2939)
Explicitly setting `hub.protocol` to `git` or using `HUB_PROTOCOL=git`
still uses the `git` protocol.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-03-25 17:46:40 +01:00
..
support Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +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 Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
apply.feature Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
authentication.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +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 Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
cherry_pick.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
ci_status.feature [ci-status] Add support for `--format` string 2019-01-29 21:54:18 +01:00
clone.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
compare.feature Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
create.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
delete.feature Enable `hub delete` on GitHub Enterprise 2018-06-06 14:06:39 +02:00
fetch.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
fish_completion.feature Allow the unsorted expansion for the fish shell 2017-05-09 20:10:57 +09:00
fork.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
gist.feature Fix assertions that fail on whitespace mismatch 2022-03-25 15:32: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 Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01: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 Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
pr-merge.feature Add functionality and tests to `pr merge` 2020-08-02 20:35:50 +02:00
pr-show.feature Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
pull_request.feature Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
push.feature Port `hub push` tests to cukes 2014-07-25 20:38:12 -07:00
release.feature Fix assertions that fail on whitespace mismatch 2022-03-25 15:32:48 +01:00
remote_add.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
steps.rb Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01:00
submodule_add.feature Change default protocol to HTTPS (#2939) 2022-03-25 17:46:40 +01: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.