Konstantin Gredeskoul
baae0305b6
Speed up bash-it Search & support exact matches
...
This commit improves Bash-It search functionality in a couple of ways:
* bash-it search (with no arguments) will print detailed help.
* bash-it search now accepts terms prefixed with '@' sign, indicating an exact match.
* bash-it search now performs smarter caching of the component listings/status
New search syntax is as follows:
bash-it search [-|@]term1 [-|@]term2 [ --enable | --disable | --help ]
2018-11-19 11:55:36 -08:00
Piotr Rogoża
48e6888a38
Removed reload keyword from composure_keywords(), it is not needed
2018-04-21 19:15:50 +02:00
Piotr Rogoża
89d1661d23
Replaced reload section with proper function.
...
Added completion for reload.
Fixed order in completion
Added unit tests for completion
The variable BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE has to be unset.
2018-04-18 21:51:20 +02:00
Dan Wendorf
c5f2c408e7
SCM_CURRENT_USER supports accented characters
...
`tr 'A-Z' 'a-z'` will only convert non-accented characters. Switching to
`[:upper:]` and `[:lower:]` adds support for accents.
See https://github.com/koalaman/shellcheck/wiki/SC2018
Additionally, printf's character splitting does not support accented
characters, so output isn't as expected. Using bash's variable expansion
syntax instead will correctly get the full accented character.
2017-12-18 09:05:33 -08:00
Dan Wendorf
150e82b221
Refactor git functionality into githelpers.theme.bash
...
- Add unit tests around git functionality
2017-12-18 09:05:33 -08:00
Nils Winkler
31990490fa
Added test for the "no" energy tool case
2017-11-02 06:46:01 +01:00
Nils Winkler
5ab0cc5388
Fixed ioreg - no battery test case
2017-11-02 06:46:01 +01:00
Nils Winkler
7ea1a58216
Added comments on the test functions
2017-11-02 06:46:01 +01:00
Nils Winkler
629b8522e5
Ensuring that output is always two digits at least
...
Show "04" instead of just "4".
2017-11-02 06:46:01 +01:00
Nils Winkler
7602b1da32
Added tests for WMIC
2017-11-02 06:46:01 +01:00
Nils Winkler
601202e816
Simplified ioreg, added tests for no status
2017-11-02 06:46:01 +01:00
Nils Winkler
486c9e1382
Consolidated cases for acpi
2017-11-02 06:46:01 +01:00
Nils Winkler
3aed38c79f
Updated acpi tests
...
Trying to cover the currently implemented tests, but I don't have a
system with acpi available for testing. Relying on assumptions so far.
2017-11-02 06:46:01 +01:00
Nils Winkler
812f49e457
Started first tests for acpi command
2017-11-02 06:46:01 +01:00
Nils Winkler
a4824cc8c8
Changed pmset test to use printf
2017-11-02 06:46:01 +01:00
Nils Winkler
b7b8a0afe0
Completed tests for upower command
2017-11-02 06:46:01 +01:00
Nils Winkler
d39d14b140
Refactored test run script so that you can run a single file
...
Call it like this:
test/run test/plugins/battery.plugin.bats
If called without any parameters, all of the tests are run.
2017-11-02 06:46:01 +01:00
Nils Winkler
5ab23e3ca0
Added test cases for acpi, upower and ioreg, need to fill in data
...
The one for ioreg works fine, the others currently fail.
2017-11-02 06:46:01 +01:00
Nils Winkler
b4c6029706
Made setup function for _command_exists generic
2017-11-02 06:46:01 +01:00
Nils Winkler
28c41efcbc
Simplified setup fixture for pmset/_command_exists
2017-11-02 06:46:01 +01:00
Nils Winkler
c221648a7f
Refactored setup function for pmset
2017-11-02 06:46:01 +01:00
Nils Winkler
c8d86858fd
Added setup function for _command_exists that works for pmset
2017-11-02 06:46:01 +01:00
Nils Winkler
d0b3205de0
Added an additional test case and a fix for using the pmset command
...
The other commands still need to be mocked and tested/fixed, too.
2017-11-02 06:46:01 +01:00
Nils Winkler
ef28b2788b
Added test cases for battery_percentage with pmset
...
Need to figure out way to ensure that pmset is used every time...
2017-11-02 06:46:01 +01:00
Nils Winkler
e729826ec0
Fixed some shellcheck warnings
2017-10-17 08:18:58 +02:00
Nils Winkler
395e9eff3c
Added a couple more tests for mkcd
...
Also fixed the order of expected/actual for lsgrep test.
2017-10-17 08:18:58 +02:00
Nils Winkler
da77e9506d
Fixed buf test case that failed from time to time
...
Taking two timestamps (one before the function-under-test, and one
after), we minimize the chance of failure.
2017-10-17 08:18:58 +02:00
Nils Winkler
3a899916bd
Removed extra line, no longer needed
2017-10-14 18:15:48 +02:00
Nils Winkler
e2f00b1eb6
Checking for link target
2017-10-14 18:02:04 +02:00
Nils Winkler
80e510d65b
Added assert_link_exist function and use that
2017-10-14 18:02:04 +02:00
Nils Winkler
e574de8f47
Moved testing for files to bats-file library functions
2017-10-14 18:02:04 +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
Mike Fiedler
8015bba27f
Exit directory upon completion, update tests
...
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-09-30 20:06:42 -04: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
Nils Winkler
145ec5dfaa
Copied command_exists function to the helpers lib so that there is no hidden dependency on the base plugin
...
The original command_exists function will stay in the base plugin, but will no longer be used by other plugins or themes.
2017-09-17 21:05:59 +02:00
Nils Winkler
0fe2710c61
More unit tests for loading from global directory structure
2017-09-17 21:05:59 +02:00
Nils Winkler
fd637a3dc6
Loading components from global enabled directory
2017-09-17 21:05:59 +02:00
Nils Winkler
5210707da8
Test cases for loading from global directory
2017-09-17 21:05:59 +02:00
Nils Winkler
f57bd1e131
Fixed issues with migrating components with the same name
...
dirs.plugin.bash was recognized while looking for dirs.completion.bash in the global enabled directory.
2017-09-17 21:05:59 +02:00
Nils Winkler
aa9a63a10e
Added message after migrating about possible fixes.
...
See #985 for background.
2017-09-17 21:05:59 +02:00
Nils Winkler
5c66f478dd
Completed test suite for Bash-it completion
2017-09-17 21:05:58 +02:00
Nils Winkler
cd578f8772
More tests for completion
2017-09-17 21:05:58 +02:00
Nils Winkler
b37da4e1f0
Updated documentation for global directory
2017-09-17 21:05:58 +02:00
Nils Winkler
be9b0e71c4
Removed test filter
2017-09-17 21:05:58 +02:00
Nils Winkler
653437e2e1
Some more tests for disable all
2017-09-17 21:05:58 +02:00
Nils Winkler
729f21c106
Reading bash-it help lists aliases from global enabled directory
2017-09-17 21:05:58 +02:00
Nils Winkler
c26476f56e
Fixed bash-it help aliases for todo.txt-cli
2017-09-17 21:05:58 +02:00
Nils Winkler
e0554cb512
Test cases and fix for bash-it help aliases foo
2017-09-17 21:05:58 +02:00
Nils Winkler
4cda9c0a43
Started work on bash-it help aliases
2017-09-17 21:05:58 +02:00
Nils Winkler
5ff873e058
Fixed "bash-it help aliases" cases, more to come...
2017-09-17 21:05:58 +02:00
Nils Winkler
298b9c6455
Added test case for completion "help aliases v"
2017-09-17 21:05:58 +02:00
Nils Winkler
688d0cb540
Some more test cases
2017-09-17 21:05:58 +02:00
Nils Winkler
05696df361
Additional test cases for completions with dashes and dots
2017-09-17 21:05:58 +02:00
Nils Winkler
ec327486ef
Checking global directory for completions as well
2017-09-17 21:05:58 +02:00
Nils Winkler
a925f5d58c
Checking for global directory when looking for components that are not enabled
2017-09-17 21:05:58 +02:00
Nils Winkler
7a3603f80d
Sorting compgen output so that the returned values are in ascending order
2017-09-17 21:05:58 +02:00
Nils Winkler
e7298a5303
Fixed case where nothing was enabled
2017-09-17 21:05:58 +02:00
Nils Winkler
adb2f1071f
Added tests for completion results with various file locations and names
2017-09-17 21:05:58 +02:00
Nils Winkler
b31c7a0afa
Refactored completion check into a reusable function
2017-09-17 21:05:58 +02:00
Nils Winkler
3e9c5655b1
Added xargs fix to some more wc -l invocations
...
Calling `xargs` removes any leading whitespace, which is introduced by
the macOS version of `wc`. See
https://stackoverflow.com/a/12973694/1228454 for more info.
2017-09-17 21:05:58 +02:00
Nils Winkler
a4c6a1aaed
Added first tests for Bash-it completion script
2017-09-17 21:05:58 +02:00
Nils Winkler
6981fa091d
Add tests for bash_it.sh script
2017-09-17 21:05:58 +02:00
Nils Winkler
d798bb8f06
Change test prefixes to match file name
2017-09-17 21:05:58 +02:00
Nils Winkler
e53b5dc96e
Add some TODO items
2017-09-17 21:05:58 +02:00
Nils Winkler
9e99c8cb3d
Adjust install test case
2017-09-17 21:05:57 +02:00
Nils Winkler
2a16a5cd68
Change install setup to use rsync instead of cp
2017-09-17 21:05:57 +02:00
Nils Winkler
9f3ef22538
Describe function supports new directory structure
2017-09-17 21:05:57 +02:00
Nils Winkler
9080f0e869
Add more tests for migration scenario
2017-09-17 21:05:57 +02:00
Nils Winkler
2b778ccbba
Fix disable/migrate test case
2017-09-17 21:05:57 +02:00
Nils Winkler
fd686cc2ae
Fix one more path
2017-09-17 21:05:57 +02:00
Nils Winkler
f72691fe85
Fix some more migration test cases
2017-09-17 21:05:57 +02:00
Nils Winkler
2ac08cae0f
Fix one migration case
2017-09-17 21:05:57 +02:00
Nils Winkler
6fa235a825
Start work on migration to global directory
2017-09-17 21:05:57 +02:00
Nils Winkler
e705e6c60f
Check for link target
2017-09-17 21:05:57 +02:00
Nils Winkler
5f3627b9b7
Change the enable/disable functions to use the global directory
2017-09-17 21:05:57 +02:00
Nils Winkler
b106d275a7
Move enable/disable functionality to global enabled directory
2017-09-17 21:05:57 +02:00
Yushin Washio
a4472fedaa
skip ruby PATH test if ruby not installed
2017-08-17 17:33:56 +05:00
Nils Winkler
2581abdf54
Fix some issues that showed the todo.txt-cli aliases in the wrong way
2017-06-24 17:31:31 +02:00
Nils Winkler
94e68b96b5
Fix migration of todo.txt-cli component
2017-06-24 17:31:31 +02:00
Nils Winkler
fc4ce80329
Add tests for enabling multiple plugins at the same time
2017-06-24 17:31:31 +02:00
Nils Winkler
1068e7916b
Add tests for enabling aliases and completions
2017-06-24 17:31:31 +02:00
Nils Winkler
87270c2962
Copy all of Bash-it during the helper tests
2017-06-24 17:31:31 +02:00
Nils Winkler
b55c0251ed
Add tests for base theme's battery functions
2017-06-24 17:31:31 +02:00
Nils Winkler
0aad8b4ab0
Fixed assert syntax
2017-06-24 17:31:31 +02:00
Nils Winkler
951fe918c0
Automatically running migration command when enabling/disabling components
2017-06-24 17:31:30 +02:00
Nils Winkler
1e624113a7
Refactored search test cases to use the assert functions
2017-06-24 17:31:30 +02:00
Nils Winkler
cb46960717
Removing enabled components before running tests
2017-06-24 17:31:30 +02:00
Nils Winkler
2607bb815a
Avoid polluting the user's Bash-it installation
...
All of the install steps are done in a test directory
2017-06-24 17:31:30 +02:00
Nils Winkler
6ff4071646
Fixed test execution that only checked for plugins starting with 2
2017-06-24 17:31:30 +02:00
Nils Winkler
dc7173b7ef
Using xargs to remove leading spaces
...
Found here: http://stackoverflow.com/a/12973694/1228454
2017-06-24 17:31:30 +02:00
Nils Winkler
bf632e19fc
Refactored tests to use helper assert functions
2017-06-24 17:31:30 +02:00
Nils Winkler
eb9a15f435
Added test cases for uninstall script
2017-06-24 17:31:30 +02:00
Nils Winkler
43b62b344a
Added test case for silent/interactive combo
2017-06-24 17:31:30 +02:00
Nils Winkler
1ace0b7a89
Checking for backup file creation
2017-06-24 17:31:30 +02:00
Nils Winkler
12ed1b79d3
Check for enabled components after install
2017-06-24 17:31:30 +02:00
Nils Winkler
b95fd6fdce
Checking config file per OS type
2017-06-24 17:31:30 +02:00
Nils Winkler
6ce9403be0
Started writing tests for the install script
2017-06-24 17:31:30 +02:00
Nils Winkler
e112eb43a0
Using local setup/teardown functions
2017-06-24 17:31:30 +02:00
Nils Winkler
9eb10c266b
Added support for local setup/teardown functions
2017-06-24 17:31:30 +02:00
Nils Winkler
402179d87d
Added prefix to bash-it test cases
2017-06-24 17:31:30 +02:00
Nils Winkler
c2446c2692
Added new "bash-it migrate" command that migrates components from the old syntax to the new one that uses the load priority
2017-06-24 17:31:30 +02:00
Nils Winkler
b1481038d8
Improved check for components that are already enabled
2017-06-24 17:31:30 +02:00
Nils Winkler
4e16dfde56
Fixed basename usage for enable all
2017-06-24 17:31:30 +02:00
Nils Winkler
d34b820cec
Added some code to figure out the directory
2017-06-24 17:31:30 +02:00
Nils Winkler
36a87a5f4e
Added some debug output
2017-06-24 17:31:30 +02:00
Nils Winkler
11330596b1
Simplified describe tests
2017-06-24 17:31:30 +02:00
Nils Winkler
65c6e6a1a6
Disable all command and test case
2017-06-24 17:31:30 +02:00
Nils Winkler
098186754c
Added test suite for enable/disable
2017-06-24 17:31:30 +02:00
Nils Winkler
58674d5a89
Updated unit tests
2016-05-23 08:45:46 +02:00
Nils Winkler
2618d2141f
Fixed unit tests
2016-05-19 09:20:39 +02:00
Konstantin Gredeskoul
db5061cf80
Better tests, more resilience and a bug fix
2016-05-12 04:04:51 -07:00
Konstantin Gredeskoul
81e3f1121b
Get the test in a known state
2016-05-07 06:42:48 -07:00
Konstantin Gredeskoul
9bb2d377a8
Enable/Disable with negated search feature
2016-05-07 06:26:30 -07:00
Konstantin Gredeskoul
fb6a6c80c0
Highlighting color of enabled components
2016-05-07 04:23:03 -07:00
Konstantin Gredeskoul
ffbeeacc54
Moving search into its own module before more work
2016-05-07 04:19:03 -07:00
Travis Swicegood
fc70767315
Ensuring BASH_IT is set before running tests
2016-04-02 02:35:48 -07:00
Konstantin Gredeskoul
8c5ec75898
Full featured search test, dig into travis failures
2016-03-24 03:05:03 -07:00
Konstantin Gredeskoul
a9bf098c7a
bash-it search functionality: allow test to skip on travis
2016-03-23 23:26:13 -07:00
Konstantin Gredeskoul
c0a657270c
Add bash-it search functionality
...
- "bash-it search term1 [term2]...."
- we are using existing 'bash-it show plugins|aliases|completions'
commands output, to search (with grep) for lines that match the
search terms, and then output the matches.
- wrote a simple unit test that for whatever reason fails on Travis,
so wrapped it in 'if "Darwin"'...
2016-03-23 23:13:51 -07: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
34670ea021
[tests] make setup function to create test dir per test
2015-05-03 18:11:27 -07:00
Ivan Povalyukhin
f1de827622
[tests] added test for base plugin mkcd(); make mkcd() safe for directory names starting with a dash
2015-05-03 18:11:18 -07:00
Ivan Povalyukhin
067f851d79
[tests] added test for plugins base lsgrep()
2015-05-03 18:11:11 -07:00
Ivan Povalyukhin
fb2134364e
skip myip() function test - it is not determenistic, probably because of the network latency
2015-04-21 21:09:51 -07:00
Ivan Povalyukhin
f420560986
make buf() to respect file attributes on file backup
2015-04-11 15:51:26 -07:00
Ivan Povalyukhin
b3334bc9e5
adjust env vars in test_helper to make CI pass
2015-03-29 18:23:24 -07:00
Ivan Povalyukhin
cbcdd66863
test base.plugin#pickfrom
2015-03-29 17:27:48 -07:00
Ivan Povalyukhin
839cf4429a
start with tests for base.plugin
2015-03-29 16:31:05 -07:00
Ivan Povalyukhin
62d705ab50
added travis.ci support
2015-03-28 18:54:37 -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
Ivan Povalyukhin
a13719f28f
test lib#composure_keywords
2015-03-28 18:54:37 -07:00