Skip to content

Commit 8b7c850

Browse files
committed
plugin tests: more informative failure messages
When a test fails, show the name of the key that failed as well as the value of that key.
1 parent 3078cd1 commit 8b7c850

1 file changed

Lines changed: 2 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!'

0 commit comments

Comments
 (0)