Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
- Completely rewritten.  No compatibility with old versions.  - Output format is changed to Test Anything Protocol version 12.  - The style to write examples is changed.  See also |vspec-examples| for the details.  - Change the order of arguments to |bin/vspec|.  - Change the syntax for |vspec-custom-matcher| to be extensible and readable.  - Add |:Expect-not| for counter examples.  - Add |:TODO| for incomplete examples.  - Add |:SKIP| for environment-specific examples.  - Add |:before| blocks and |:after| blocks.
  • Loading branch information
Kana Natsuno authored and vim-scripts committed Mar 7, 2012
1 parent 484aa52 commit e66b3fe
Show file tree
Hide file tree
Showing 40 changed files with 2,328 additions and 1,099 deletions.
4 changes: 2 additions & 2 deletions .mduem/cache/Makefile.variables
@@ -1,6 +1,6 @@
all_files_in_repos := Makefile after/syntax/vim/vspec.vim autoload/vspec.vim bin/vspec doc/vspec.txt test/context.expected test/context.input test/custom-matcher.expected test/custom-matcher.input test/no-test.expected test/no-test.input test/syntax.expected test/syntax.input test/tools.expected test/tools.input test/typical-content.expected test/typical-content.input
all_files_in_repos := Makefile after/indent/vim.vim after/syntax/vim/vspec.vim autoload/vspec.vim bin/vspec doc/vspec.txt t/after.vim t/before.vim t/builtin-matchers.vim t/check-vspec-result t/context.vim t/custom-matchers.vim t/error-in-describe.t t/error-in-it.t t/error-in-should-evaluating.t t/error-in-should-parsing.t t/error-in-source.t t/indent.vim t/no-hint.vim t/no-test.vim t/should.vim t/skip.t t/syntax.vim t/todo.t t/tools.vim
current_branch := master
origin_name := origin
origin_uri := ../.
repos_name := vim-vspec
version := 0.0.4
version := 1.0.0
2 changes: 1 addition & 1 deletion README
Expand Up @@ -4,7 +4,7 @@ This is a mirror of http://www.vim.org/scripts/script.php?script_id=3012


Requirements:
- Vim 7.2 or later
- Vim 7.3 or later

Latest version:
http://github.com/kana/vim-vspec
Expand Down
48 changes: 48 additions & 0 deletions after/indent/vim.vim
@@ -0,0 +1,48 @@
" Vim additional indent settings: vim/vspec - indent vspec commands
" Version: 1.0.0
" Copyright (C) 2012 Kana Natsuno <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}

" NB: This file should be named after/indent/vim/vspec.vim, but unlike
" $VIMRUNTIME/ftplugin.vim, $VIMRUNTIME/indent.vim does not :runtime! neither
" indent/{filetype}_*.vim nor indent/{filetype}/*.vim.

let &l:indentexpr = 'GetVimVspecIndent(' . &l:indentexpr . ')'

if exists('*GetVimVspecIndent')
finish
endif

function GetVimVspecIndent(base_indent)
let indent = a:base_indent

let base_lnum = prevnonblank(v:lnum - 1)
let line = getline(base_lnum)
if 0 <= match(line, '\(^\||\)\s*\(after\|before\|describe\|it\)\>')
let indent += &l:shiftwidth
endif

return indent
endfunction

" __END__
" vim: foldmethod=marker
17 changes: 10 additions & 7 deletions after/syntax/vim/vspec.vim
@@ -1,6 +1,6 @@
" Vim additional syntax: vim/vspec - highlight vspec commands
" Version: 0.0.4
" Copyright (C) 2010 kana <http://whileimautomaton.net/>
" Version: 1.0.0
" Copyright (C) 2010-2012 Kana Natsuno <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
Expand All @@ -22,18 +22,21 @@
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}

syntax keyword vimVspecCommand It skipwhite nextgroup=vimVspecItArgument
syntax keyword vimVspecCommand after
syntax keyword vimVspecCommand before
syntax keyword vimVspecCommand describe skipwhite nextgroup=vimString
syntax keyword vimVspecCommand end
syntax keyword vimVspecCommand Expect skipwhite
syntax keyword vimVspecCommand it skipwhite nextgroup=vimString
syntax keyword vimVspecOperator not skipwhite
syntax keyword vimVspecCommand ResetContext
syntax keyword vimVspecCommand SaveContext
syntax keyword vimVspecCommand Should skipwhite nextgroup=vimFunc,vimString

syntax match vimVspecItArgument /\S.*$/ contained




highlight default link vimVspecCommand vimCommand
highlight default link vimVspecItArgument String
highlight default link vimVspecOperator vimOper

" __END__
" vim: foldmethod=marker

0 comments on commit e66b3fe

Please sign in to comment.