Skip to content

Commit 03626a3

Browse files
committed
tests: quote paths
1 parent 84383cb commit 03626a3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

test/plugins/xterm.plugin.bats

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bats
22

33
load ../test_helper
4+
load ../../lib/log
45
load ../../lib/helpers
56
load "${BASH_IT}/vendor/github.com/erichs/composure/composure.sh"
67

@@ -21,30 +22,30 @@ function local_setup {
2122

2223
@test "plugins xterm: shorten command output" {
2324
export SHORT_TERM_LINE=true
24-
run _short-command ${BASH_IT}/test/fixtures/plugin/xterm/files/*
25+
run _short-command "${BASH_IT}/test/fixtures/plugin/xterm/files"/*
2526
assert_success
26-
assert_output ${BASH_IT}/test/fixtures/plugin/xterm/files/arg0
27+
assert_output "${BASH_IT}/test/fixtures/plugin/xterm/files/arg0"
2728
}
2829

2930
@test "plugins xterm: full command output" {
3031
export SHORT_TERM_LINE=false
31-
run _short-command ${BASH_IT}/test/fixtures/plugin/xterm/files/*
32+
run _short-command "${BASH_IT}/test/fixtures/plugin/xterm/files"/*
3233
assert_success
33-
assert_output "$(echo ${BASH_IT}/test/fixtures/plugin/xterm/files/*)"
34+
assert_output "$(echo "${BASH_IT}/test/fixtures/plugin/xterm/files"/*)"
3435
}
3536

3637
@test "plugins xterm: shorten dirname output" {
3738
export SHORT_TERM_LINE=true
3839
run _short-dirname
3940
assert_success
40-
assert_output "$(basename $PWD)"
41+
assert_output "$(basename "${PWD}")"
4142
}
4243

4344
@test "plugins xterm: full dirname output" {
4445
export SHORT_TERM_LINE=false
4546
run _short-dirname
4647
assert_success
47-
assert_output $PWD
48+
assert_output "${PWD}"
4849
}
4950

5051
@test "plugins xterm: set xterm title" {

test/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ -z "${BASH_IT}" ]; then
1111
fi
1212

1313
if [ -z "$1" ]; then
14-
test_dirs=( ${test_directory}/{bash_it,completion,install,lib,plugins,themes} )
14+
test_dirs=( "${test_directory}"/{bash_it,completion,install,lib,plugins,themes} )
1515
else
1616
test_dirs=( "$1" )
1717
fi

0 commit comments

Comments
 (0)