Skip to content

Commit

Permalink
Merge pull request editorconfig#183 from cxw42/expect-improvement
Browse files Browse the repository at this point in the history
plugin tests: more informative failure messages
  • Loading branch information
cxw42 authored Jan 22, 2022
2 parents 3078cd1 + 5770315 commit a8e3e66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/plugin/spec/editorconfig_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def test_editorconfig(vim, file_name, expected_values)
vim.edit(File.join(BASE_PATH, file_name))

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

vim.command 'bd!'
Expand Down
11 changes: 11 additions & 0 deletions tests/travis-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ if [[ ( ! "${TEST_WHICH:-}" ) && "${1:-}" ]]; then
export TEST_WHICH="$1"
fi

if [[ ! "${TEST_WHICH:-}" ]]; then
cat <<EOT
Usage: $0 \$WHICH
or: TEST_WHICH=\$WHICH $0
Run automated tests of editorconfig-vim
\$WHICH can be "core" or "plugin".
EOT
exit 2
fi

if [[ "$TEST_WHICH" = 'plugin' ]]; then # test plugin

# If not running from Travis, do what Travis would have
Expand Down

0 comments on commit a8e3e66

Please sign in to comment.