Skip to content

Commit a8e3e66

Browse files
authored
Merge pull request #183 from cxw42/expect-improvement
plugin tests: more informative failure messages
2 parents 3078cd1 + 5770315 commit a8e3e66

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

tests/plugin/spec/editorconfig_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def test_editorconfig(vim, file_name, expected_values)
1818
vim.edit(File.join(BASE_PATH, file_name))
1919

2020
expected_values.each do |key, val|
21-
expect(vim.echo("&l:#{key}")).to eq(val)
21+
vimval = vim.echo("&l:#{key}")
22+
expect(vimval).to eq(val), "key #{key} had value #{vimval}, but I expected #{val}"
2223
end
2324

2425
vim.command 'bd!'

tests/travis-test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ if [[ ( ! "${TEST_WHICH:-}" ) && "${1:-}" ]]; then
1111
export TEST_WHICH="$1"
1212
fi
1313

14+
if [[ ! "${TEST_WHICH:-}" ]]; then
15+
cat <<EOT
16+
Usage: $0 \$WHICH
17+
or: TEST_WHICH=\$WHICH $0
18+
Run automated tests of editorconfig-vim
19+
20+
\$WHICH can be "core" or "plugin".
21+
EOT
22+
exit 2
23+
fi
24+
1425
if [[ "$TEST_WHICH" = 'plugin' ]]; then # test plugin
1526

1627
# If not running from Travis, do what Travis would have

0 commit comments

Comments
 (0)