8000 GitHub - spellman/vim-minitest: Run Minitest tests from Vim
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

spellman/vim-minitest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Minitest.vim

This is a Minitest adaptation of Rspec.vim from thoughtbot. to run specific tests from Vim.

NOTE: 2016-02-21: I think minitest-line makes this plugin obsolete.

Installation

Recommended installation with vundle:

Bundle 'spellman/vim-minitest'

Running all tests is achieved via running /test/test_helper.rb, which should require all tests. I used the following code in test_helper.rb from the CrashRuby blog. Note this assumes that vim's working directory is the project root.

require "minitest/autorun"
require "bundler/setup"

if __FILE__ == $0
  $LOAD_PATH.unshift "lib", "test"
  Dir.glob("./test/**/test_*.rb") { |f| require f }
end

Example of key mappings

" Minitest.vim mappings
nmap <Leader>t <Plug>vim-minitest#RunCurrentTestFile
nmap <Leader>s <Plug>vim-minitest#RunNearestTest
nmap <Leader>l <Plug>vim-minitest#RunLastTest
nmap <Leader>a <Plug>vim-minitest#RunAllTests

Configuration

Overwrite g:minitest_command variable to execute a custom command.

Example:

let g:minitest_command = "!ruby -Itest {test}"

About

Run Minitest tests from Vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 92.2%
  • AppleScript 7.8%
0