ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Harvey

by rayje ST2

A Sublime Text 2 plugin to assist in developing Harvey tests

Details

  • 0.0.7
  • github.​com
  • github.​com
  • 11 years ago
  • 34 minutes ago
  • 11 years ago

Installs

  • Total 22
  • Win 14
  • Mac 3
  • Linux 5
Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

harvey-sublime plugin

A Sublime plugin to assist in creating tests with Harvey

Features

The following are the commands the plugin provides: * harvey_run_test - Runs a single test or all tests in a Harvey test file. * harvey_select_test - Runs the test selected from a quick panel. * harvey_last_test - Re-runs the last test.

Each of the commands listed above can be output either to a scratch file or to the console.

The harvey_run_test and harvey_select_test commands both take default arguments that define how to run and output the test. Each of the arguments can be overridden by adding an entry to your default keymap file.

Installation Options

  • Package Control

  • Go to your Sublime Text 2 Packages directory

    • OS X: ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
    • Windows: %APPDATA%/Sublime Text 2/Packages/
    • Linux: ~/.config/sublime-text-2/Packages/

and clone the repository:

git clone git@github.com:rayje/harvey-sublime.git Harvey

Usage

  • To run a test either highlight the Test ID or place the cursor within the Test ID text.

Keyboard mappings

The following are the default key mapping for the commands listed above. The defaults can be overridden by adding an entry to the Default keymap - User file.

Mac: - Run single harvey test (reporter=console, output=console): Command-Shift-R - Run single harvey test (reporter=json, output=scratch): Command-Shift-G - Run all tests in harvey test file (reporter=console, output=console): Command-Shift-A - Run all tests in harvey test file (reporter=json, output=scratch): Command-Shift-O - Select a test to run from quick panel (reporter=json, output=scratch): Command-Shift-I - Select a test to run from quick panel (reporter=console, output=console): Command-Shift-U - Run the last test: Command+Shift+L - Create a scratch file: Command+Shift+X - Show the panel: Alt+Shift+O

Linux/Windows: - Run single harvey test (reporter=console, output=console): Control-Shift-R - Run single harvey test (reporter=json, output=scratch): Control-Shift-G - Run all tests in harvey test file (reporter=console, output=console): Control-Shift-A - Run all tests in harvey test file (reporter=json, output=scratch): Control-Shift-O - Select a test to run from quick panel (reporter=json, output=scratch): Control-Shift-I - Select a test to run from quick panel (reporter=console, output=console): Control-Shift-U - Run the last test: Control+Shift+L - Create a scratch file: Control+Shift+X - Show the panel: Alt+Shift+O

Overriding Default Keybindings

To override the default keybindings your User Keybinding File and add the following keybindings:

To override the harvey_run_test command

[
    {
        "keys": ["ctrl+shift+r"],
        "command": "harvey_run_test",
        "args": {
            // To run all tests in a test file, set this value to true
            "all": false,
            // Reporter to be used in the Harvey command
            // Valid reporters: console, json
            "reporter": "console",
            // To output to a scratch file, set this value to true
            // false will output to console
            "scratch": false
        }
    }
]

To override the harvey_select_test command

[
    {
        "keys": ["super+shift+u"],
        "command": "harvey_select_test",
        "args": {
            // Reporter to be used in the Harvey command
            // Valid reporters: console, json
            "reporter": "console",
            // To output to a scratch file, set this value to true
            // false will output to console
            "scratch": false
        }
    }
]

Configuring

There are a few settings available to customize the harvey-sublime plugin. For the latest information on what settings are available, select the menu item Preferences->Package Settings->Harvey->Settings - Default.

Do NOT edit the default harvey-sublime settings. Your changes will be lost when the plugin is updated. ALWAYS edit the user harvey-sublime settings by selecting Preferences->Package Settings->Harvey->Settings - User. Note that individual settings you include in your user settings will completely replace the corresponding default setting, so you must provide that setting in its entirety.

Settings

The following is a description of the settings that can be overridden in the settings file:

  • node - This is the location where the node executable lives. By default it expects the executable to be on the user's PATH. To configure the plugin to use another version of node.

  • harvey-test-dir - This is the directory within the current project where the harvey tests live. (Default: test/integration)

  • harvey - The location of the Harvey executable. (Default: node_modules/harvey/bin/harvey)

  • config - The config file to be used in the command line argument. (Default: test/integration/config.json)