Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Abstract how to generate failure message

The original behavior on custom matcher is intentionally omitted.
It will be revised soon.
  • Loading branch information...
commit 548cc04f7f79f88b37ecac2196b36256697a5c47 1 parent 61ee87d
@kana authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 autoload/vspec.vim
View
17 autoload/vspec.vim
@@ -241,10 +241,9 @@ function! vspec#test(specfile_path) "{{{2
\ example
\ )
echo '# Expected' i.expr_actual i.expr_matcher i.expr_expected
- echo '# Actual value:' string(i.value_actual)
- if !s:is_custom_matcher(i.expr_matcher)
- echo '# Expected value:' string(i.value_expected)
- endif
+ for line in s:generate_failure_message(i)
+ echo '# ' . line
+ endfor
elseif type ==# 'TODO'
echo printf(
\ '%s %d - # TODO %s %s',
@@ -640,6 +639,16 @@ endfunction
+function! s:generate_failure_message(i) "{{{2
+ return [
+ \ ' Actual value: ' . string(a:i.value_actual),
+ \ 'Expected value: ' . string(a:i.value_expected),
+ \ ]
+endfunction
+
+
+
+
function! s:is_custom_matcher(expr_matcher) "{{{2
return a:expr_matcher =~# '^to'
endfunction
Please sign in to comment.
Something went wrong with that request. Please try again.