Vim spec/test runner
CoffeeScript Vim script Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.gitignore
.travis.yml
LICENSE-MIT
README.md
package.json

README.md

VimSpec

Build Status

Vim spec/test framework.

Currently, the only supported assertion is "AssertEquals" but I'm planning to add more in the future.

Installation

npm install -g vimspec

Example usage

In your plugin, create a test directory with files that end with '_test.vim' or '_spec.vim'.

A spec file looks like this:

source test/fixtures/file.vim

function! TestAdd()
  call Describe("Add(1,2)")
  call AssertEquals(Add(1,2), 3)
endfunc

function! TestSubtract()
  call Describe("Subtract(1,2)")
  call AssertEquals(Subtract(1,2), -1) 
endfunc

Within the plugin's root directory run "vimspec", you will see this output (with colors):

test/fixtures/file_spec.vim
  #TestAdd:
    Add(1,2)
      ✓ equals 3
  #TestSubtract:
    Subtract(1,2)
      ☓ expected '2' to equal '-1'