1
0
Fork 0
emacs-config/test/integration/oni-core.bats
Tom Willemse a49fda9c79 Use ws-butler
At work I have to work with a lot of files that other people work on as well.
Other people don’t usually have their editor set up to remove all trailing
whitespace, and we’re not allowed to make a change that includes a lot of extra
whitespace changes[1]. So I end up having to revert a lot of whitespace changes
just before submitting. And if I then have to make more changes, for example
because something was pointed out in a code review, I have to do it again.

‘ws-butler’ promises that it will still prevent me from submitting extraneous
whitespace, but will not touch lines that I haven’t changed, so that would
prevent me from having to revert them all the time.

[1]: This is good, having a lot of whitespace changes can distract from or even
completely hide the actual change you’re trying to make.
2020-10-15 14:25:18 -07:00

55 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bats
@test "Opening emacs loads oni-core" {
run emacs -batch -l package -f package-initialize \
-eval "(prin1 (featurep 'oni-core))"
echo "$output"
[[ "$output" == *"t" ]]
}
@test "C-a is bound to oni-core-move-to-beginning-of-dwim" {
run emacs -batch -l package -f package-initialize \
-eval "(prin1 (key-binding (kbd \"C-a\")))"
echo "$output"
[[ "$output" == *"oni-core-move-beginning-of-dwim" ]]
}
@test "C-e is bound to oni-core-move-to-end-of-dwim" {
run emacs -batch -l package -f package-initialize \
-eval "(prin1 (key-binding (kbd \"C-e\")))"
echo "$output"
[[ "$output" == *"oni-core-move-end-of-dwim" ]]
}
@test "Starting Emacs diminishes gcmh-mode" {
run emacs -batch -l package -f package-initialize -l subr-x \
-eval "(prin1 (string-empty-p (car (alist-get 'gcmh-mode minor-mode-alist))))"
echo "$output"
[[ "$output" == *"t" ]]
}
@test "Starting Emacs diminishes ws-butler-global-mode" {
run emacs -batch -l package -f package-initialize -l subr-x \
-eval "(prin1 (string-empty-p (car (alist-get 'ws-butler-mode minor-mode-alist))))"
echo "$output"
[[ "$output" == *"t" ]]
}
@test "Starting Emacs turns on ws-butler-mode" {
run emacs -batch -l package -f package-initialize \
-eval "(prin1 (bound-and-true-p ws-butler-mode))"
echo "$output"
[[ "$output" == *"t" ]]
}