Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sovetnik/vim-minispec
The "Vim Minispec" plugin runs Minitest spec and displays the results in Vim quickfix window.
https://github.com/sovetnik/vim-minispec
minitest vim vim-plugin
Last synced: 25 days ago
JSON representation
The "Vim Minispec" plugin runs Minitest spec and displays the results in Vim quickfix window.
- Host: GitHub
- URL: https://github.com/sovetnik/vim-minispec
- Owner: sovetnik
- Created: 2017-04-17T22:36:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T01:14:37.000Z (over 4 years ago)
- Last Synced: 2024-08-03T18:12:55.658Z (4 months ago)
- Topics: minitest, vim, vim-plugin
- Language: Vim script
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-hanami - Vim Minispec - plugin runs your Gem or Hanami Minitest specs and displays the results in Vim quickfix. (Hanami Gem List / Editors and IDE)
README
# Vim Minispec
The **Vim Minispec** plugin runs your Gem or [Hanami](http://hanamirb.org/) [Minitest](https://github.com/seattlerb/minitest) specs and displays the results in Vim quickfix. If no any errors or warnings, it echoes output last line, like: '23 tests, 42 assertions, 0 failures, 0 errors, 0 skips'
## Requirements
If you can run your minitest file like `ruby spec/awesome_spec.rb` or `rake test` you can use a plugin.
In your `spec/spec_helper.rb` must exist a line `require 'minitest/autorun'`or in `.hanamirc` must exist a line `test=minitest`.## Installation
Get plugin and place `minispec.vim` in your Vim plugin directory.
When you have Vundle or Plug, add to your `~/.vimrc` or `~/.config/nvim/init.vim` something like:
```
Plug 'sovetnik/vim-minispec'
```
For Pathogen copy and paste:
```
cd ~/.vim/bundle
git clone 'git://github.com/sovetnik/vim-minispec.git'
```
## UsageThe plugin registers `r` and `t` in normal mode for triggering it easily.
You can use **Leader-r**(Run spec) to run some command in order:
- Run current spec if filename match `*_spec.rb` or have a related spec.
Examples of supported files:
- `apps/web/controllers/fragments/show.rb`
- `apps/web/views/fragments/show.rb`
- `lib/project/entities/awesome.rb`
- `spec/project/entities/awesome_spec.rb`
- and so on.
- Run last runned spec if exists one.
- Run all tests by 'rake test'or **Leader-t**(run Total) anywhere in project to run all tests.
Additionally, if you have installed Tim Pope's [vim-unimpaired](https://github.com/tpope/vim-unimpaired), you can use **[q** and **]q** to navigate through list of errors.
Otherwise use `:cprevious` and `:cnext`.In the quickfix window, you can use:
o to open (same as enter)
q to close the quickfix window## Troubleshooting
If you press `r` or `t`and shit and/or nothing happens, try direct commands:
- `:!ruby %`
- `rake` or `rake test`
This show you unfiltered console output.
Remember about rake must be runned from project root.
Usually, plugin cd in your project root before each run, but we in troubleshoot section, so try `:pwd`. Output must be looks like your root.## License
The Vim Minispec plugin is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).