Giter VIP home page Giter VIP logo

spec.vim--link's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2580

This plugin provides a small set of commands to facilitate 
behaviour-driven design of vim plugins. It basically consists of two 
parts:

    spec   ... BDD-related commands
    should ... Convenience functions for testing

According to BDD theory, you are supposed to write a specification first 
and then make the code fulfill that specification. If you don't believe 
in BDD, you could also think of spec.vim as a more convenient approach 
to unit testing.

An example specification could look like this:

    SpecBegin 'title': 'Foo', 'sfile': 'autoload/foo.vim'

    It should add numbers.
    Should be equal foo#Add(1, 2), 3
    
    It should not add values of incompatible types.
    Should throw something 'foo#Add("1", 2)'

Specification scripts basically are normal vim scripts but must be run 
by the |:Spec| command.

    :Spec[!] [PATH]
        Run one or more specification files.
        PATH can be either a file or a directory.

Each specification file should contain a :SpecBegin command that defines 
the title, and optionally the script context, before/after commands, the 
contents of a scratch buffer, option sets etc.

    :SpecBegin [ARGUMENTS AS INNER DICTIONNARY]
        Establish the environment for the current specification.
        Known keys for ARGUMENTS:
        
          title   ... The test's title.
          file    ... The script context.
          before  ... Code to be run before each test
          after   ... Code to be run after each test
          scratch ... Run spec in scratch buffer
          cleanup ... A list of function names that will be removed
          options ... Run the spec against different option sets

Examples:
http://github.com/tomtom/vimtlib/tree/master/spec/

spec.vim--link's People

Contributors

tomtom avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.