Commit Graph

19 Commits (9a71556b9980469f71e5cbcda6651e77fb44f3bc)

Author SHA1 Message Date
John D Pell a36a4c4038 test/ruby: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 5eab3bd288 lib/helpers: first `shellcheck` pass
Quote things, SC2268, SC2143, SC2181, SC2162, SC2016, SC2013, &c.

Rewrite globbing per `shellcheck`’s SC2013, and alsö s/typeset/local/g. Eliminate `compgen` where possible.

Alsö: use the existing utility functions `_bash-it-get-component-type-from-path` and `_bash-it-get-component-name-from-path`, which just use parameter substitution anyway. Why was `sed` here?

Alsö, don't add not-existing directories to `$PATH` in `pathmunge()`.

Finally, merge PR #1865 from NoahGorny...and clean it a bit...
2022-01-18 11:02:21 -08:00
John D Pell c35ed44cbf plugins/ruby: tests on Mac OS X
Test was failing only on Mac OS X for some reason, so refactor a little. It turned out to be due to explicitly setting `$HOME` *after* loading the plugin.
2022-01-08 08:29:13 -08:00
John D Pell da6b27166f tests: new file `test_helper_libs.bash`
For testing non-core files, just `load ../test_helper_libs` after `load ../test_helper` instead of trying to guess which libs must be loaded, in which order, for testing to succeed.

`_command_exists` spews log messages, so our test log is littered with `_log_debug not found`. This fixes that too.
2022-01-08 08:29:13 -08:00
John D Pell 9dcbeec7ad tests: test_helper already loads `composure.sh`
...and `cite()`s metadata
2022-01-08 08:29:13 -08:00
buhl 49d7d2e8c4 Getting Bash-it to use the vendored composure
Fixed tests
Fixed install.sh and bash_it.sh
Added gitattributes to the vendor folder
Changed documentation
2021-02-02 16:34:04 +01:00
Nils Winkler 818a95d79c
Refactored test setup code
Removed the copy/paste code, moved it into a reusable function that can
be called from the `local_setup` function as needed. Also simplified the
handling of the $HOME variable since @rico-chet provided a better way of
doing this.
2020-04-21 08:25:40 +02:00
Nils Winkler 34993f5da3
Excluding enabled directory when setting up test fixtures 2020-04-21 08:25:40 +02:00
Nils Winkler 3093273425
Updated rsync command to work with latest version of bats-core 2020-04-21 08:25:39 +02:00
Nils Winkler 2691a5b138 Moved to bats-assert for assert functions 2017-10-14 18:00:43 +02:00
Nils Winkler 8319545b0a Switched to Bats-core as a submodule
Can't use the official v0.4.0 release, since our tests rely on a change
that was made after the release of v0.4.0.

This code currently uses an unversioned commit of the bats-core repo, we
will switch to a supported version once it has been released, e.g.
v0.4.1.
2017-10-14 18:00:43 +02:00
Nils Winkler 3f6f1326dc Fixed ruby test for good (hopefully) 2017-09-17 21:05:59 +02:00
Nils Winkler 3103609640 Reverted Ruby path fix 2017-09-17 21:05:59 +02:00
Nils Winkler 548563e7aa Trying to fix path issue 2017-09-17 21:05:59 +02:00
Nils Winkler f4fa9def14 Fixed the ruby path test in cases where someone already has the ruby bin path on their path variable 2017-09-17 21:05:59 +02:00
Yushin Washio a4472fedaa skip ruby PATH test if ruby not installed 2017-08-17 17:33:56 +05:00
Ivan Povalyukhin 1cb9093c9c [pathmunge] fix test and modify metadata syntax in the function pathmunge to be easier supported in the test 2015-06-07 20:23:19 -07:00
Ivan Povalyukhin 3c0db284ac added test/README with small guides about testing framework 2015-03-28 18:54:37 -07:00
Ivan Povalyukhin 28e5c99816 added test example for plugin and lib 2015-03-28 18:54:37 -07:00