Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test helpers from tests/template.bats to lib/ #186

Closed
6 tasks done
mbland opened this issue Aug 27, 2017 · 1 comment
Closed
6 tasks done

Move test helpers from tests/template.bats to lib/ #186

mbland opened this issue Aug 27, 2017 · 1 comment
Assignees
Milestone

Comments

@mbland
Copy link
Owner

mbland commented Aug 27, 2017

At least some of the test helpers from tests/template.bats in v1.6.0 should be migrated to lib/.

These will certainly be migrated to lib/bats/helpers:

  • skip_if_none_present_on_system
  • git_for_windows_native_path
  • create_forwarding_script

These may contain useful bits worth extracting, though migration isn't yet certain:

  • assert_go_core_unpacked
  • create_fake_tarball_if_not_using_real_url
  • run_with_download_program
@mbland mbland added this to the v1.7.0 milestone Aug 27, 2017
@mbland mbland self-assigned this Aug 27, 2017
mbland added a commit that referenced this issue Aug 29, 2017
This is one of the functions listed #186 as a candidate for migration
from `tests/template.bats`. I realized it would be helpful to have this
function while migrating the assertions from `tests/scripts/serve.bats`
in mbland/custom-links per #181.

This commit contains two additional changes:

It removes the `--in-process` option from `stub_program_in_path`. It
turns out I wasn't using that option anywhere, and I couldn't make any
tests fail because it didn't have an effect anyway, since the `run`
function from Bats always launches its arguments in a new subshell.

`restore_program_in_path` now strips `BATS_TEST_BINDIR` from the
beginning of `PATH`.
mbland referenced this issue Aug 30, 2017
bats/helpers: Add create_forwarding_script
mbland added a commit that referenced this issue Sep 2, 2017
Part of #186. Extracted from `test/template.bats`.
mbland referenced this issue Sep 2, 2017
bats/helpers: Add skip_if_none_present_on_system
mbland added a commit that referenced this issue Sep 2, 2017
Closes #187. Part of #186. Replaces `git_for_windows_native_path` and
updates the interface to print to a result variable rather than standard
output, avoiding a subshell when no conversion takes place.
mbland added a commit that referenced this issue Sep 2, 2017
Closes #187. Part of #186. Replaces `git_for_windows_native_path` and
updates the interface to print to a result variable rather than standard
output, avoiding a subshell when no conversion takes place.
mbland referenced this issue Sep 2, 2017
lib/portability: Add @go.native_file_path_or_url
mbland added a commit that referenced this issue Sep 9, 2017
Part of #186. Prerequisite for the upcoming `@go.create_gzipped_tarball`
in the upcoming `lib/archive`.
mbland referenced this issue Sep 10, 2017
lib/fileutil: Add @go.mirror_directory
mbland added a commit that referenced this issue Sep 10, 2017
Part of #186. Throws in the kitchen sink when it comes to sanity checks
and portability.
@mbland
Copy link
Owner Author

mbland commented Sep 10, 2017

This will get closed by #211. As noted above by the issues linked to this thread, skip_if_none_present_on_system is now and create_forwarding_script are now part of lib/bats/helpers (#192, #198), and git_for_windows_native_path has become @go.native_file_path_or_url in lib/portability (#201).

But of the remaining helpers, assert_go_core_unpacked proved unnecessary, and both create_fake_tarball_if_not_using_real_url and run_with_download_program are too specific to tests/template.bats, I've decided.

mbland referenced this issue Sep 10, 2017
Add @go.create_gzipped_tarball and perform other small refactors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant