From 91fedafeb1fc79c9001bb91d319aa507996c867e Mon Sep 17 00:00:00 2001 From: Ben Simpson Date: Thu, 22 May 2014 16:01:53 -0400 Subject: [PATCH 1/2] Improve documentation * Format the examples to read better using markdown syntax * Include sample commands for Spork and Spring test preloaders --- README | 50 +++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/README b/README index b87a038..0525e17 100644 --- a/README +++ b/README @@ -11,30 +11,42 @@ Copy all files to your ~/.vim directory. Usage ----- -After installation, press t will run the test under your cursor if you are editing a ruby test file. +After installation, press `t` will run the test under your cursor if you are editing a ruby test file. -example: +Example: +``` $ cd $ vim test/unit/user_test.rb -(move cursor into a test case, press t) +``` +(move cursor into a test case, press `t`) -( is mapping to '\' by default in vim) +(`` is mapping to '\' by default in vim) Be default, the plugin will print output in terminal. You can change this behavior by putting this line in your vimrc file: - let g:rubytest_in_quickfix = 1 + let g:rubytest_in_quickfix = 1 -With this set, test errors will be displayed in quickfix window, and you can jump to the error location quickly by select the error message and hit return (or 'Ctrl-w return' to open it in new window). +With this set, test errors will be displayed in quickfix window, and you can jump to the error location quickly by select the error message and hit return (or `Ctrl-w return` to open it in new window). You can customize the command which will be used to run the test case by setting these options in your vimrc file: - let g:rubytest_cmd_test = "ruby %p" - let g:rubytest_cmd_testcase = "ruby %p -n '/%c/'" - let g:rubytest_cmd_spec = "spec -f specdoc %p" - let g:rubytest_cmd_example = "spec -f specdoc %p -e '%c'" - let g:rubytest_cmd_feature = "cucumber %p" - let g:rubytest_cmd_story = "cucumber %p -n '%c'" + let g:rubytest_cmd_test = "ruby %p" + let g:rubytest_cmd_testcase = "ruby %p -n '/%c/'" + let g:rubytest_cmd_spec = "spec -f specdoc %p" + let g:rubytest_cmd_example = "spec -f specdoc %p -e '%c'" + let g:rubytest_cmd_feature = "cucumber %p" + let g:rubytest_cmd_story = "cucumber %p -n '%c'" + +### Using [Spork](https://github.com/sporkrb/spork) + + let g:rubytest_cmd_test = "bundle exec testdrb %p" + let g:rubytest_cmd_testcase = "bundle exec testdrb %p -- -n '/%c/'" + +### Using [Spring](https://github.com/rails/spring) + + let g:rubytest_cmd_test = "bundle exec spring testunit %p" + let g:rubytest_cmd_testcase = "bundle exec spring testunit %p -n '/%c/'" Placeholders: @@ -42,20 +54,20 @@ Placeholders: * `%c`: test case name * `%s`: only for minitest, replaced by closest suite name (class whose name begin with 'Test'). This can be used to match test case more exactly: - let g:rubytest_cmd_testcase = "ruby %p -n '%s#%c'" + let g:rubytest_cmd_testcase = "ruby %p -n '%s#%c'" Default Key Bindings -------------------- -t: run test case under cursor -T: run all tests in file -l: run the last test, from any buffer +* `t`: run test case under cursor +* `T`: run all tests in file +* `l`: run the last test, from any buffer You can change default key bindings: - map \ RubyTestRun " change from t to \ - map ] RubyFileRun " change from T to ] - map / RubyTestRunLast " change from l to / + map \ RubyTestRun " change from t to \ + map ] RubyFileRun " change from T to ] + map / RubyTestRunLast " change from l to / Tip --- From ec598b0079ff4fa6f948a2555014bf6006828fa2 Mon Sep 17 00:00:00 2001 From: Ben Simpson Date: Thu, 22 May 2014 16:03:04 -0400 Subject: [PATCH 2/2] Add markdown file extension to parse syntax on Github --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md