A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vim-test/vim-test/wiki/Minitest below:

Minitest · vim-test/vim-test Wiki · GitHub

It's difficult to run individual tests with Minitest, because it doesn't accept line numbers (like RSpec), it only accepts regexes and test names. Test.vim, however, polyfills this limitation by parsing the file to determine which test is the closest to your cursor, and constructs a regex.

All of the Minitest syntaxes are supported:

Test.vim's Minitest wrapper chooses the executable using the following logic:

  1. If you have a Rakefile with a Rake::TestTask defined, or you're using Rails, then
  2. if .zeus.sock is detected run zeus rake test,
  3. otherwise if bin/rake is present, run bin/rake,
  4. otherwise if Gemfile is present, run bundle exec rake,
  5. otherwise run rake.
  6. If Rakefile is not present, then
  7. if Gemfile is present, run bundle exec ruby -I test,
  8. otherwise run ruby -I test.

Whether or not you're using Rake for running your Minitest suite, Test.vim goes to great lengths to provide the same experience.

When using Rake, it's really difficult to pass test options. Luckily, test.vim has solved that problem for you:

:TestFile --seed 1234
=> rake test TEST="your_file_test.rb" TESTOPTS="--seed=1234"
ruby -I test improvements

When not using Rake, it's really difficult to run the whole test suite. Test.vim has got your back here as well:

:TestSuite
=> ruby -I test -e 'Dir["./test/**/*_test.rb"].each &method(:require)'

If you want test.vim to use M for running tests, you can set the executable:

let g:test#ruby#minitest#executable = 'm'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4