Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #70 from bigloser/add_single_test_option_for_rspec

add RdbTestSingle command option that will pass line to rspec command
  • Loading branch information...
commit 631a9ebbb13a75ed6e8e72b52d197301452777d8 2 parents a83d9cb + 97192e3
Anton Astashov authored
View
5 autoload/ruby_debugger.vim
@@ -692,10 +692,11 @@ endfunction
" Debug current opened test
-function! RubyDebugger.run_test() dict
+function! RubyDebugger.run_test(...) dict
let file = s:get_filename()
if file =~ '_spec\.rb$'
- call g:RubyDebugger.start(g:ruby_debugger_spec_path . ' ' . file)
+ let line = a:0 && a:0 > 0 && !empty(a:1) ? a:1 : " "
+ call g:RubyDebugger.start(g:ruby_debugger_spec_path . ' ' . file . line)
elseif file =~ '\.feature$'
call g:RubyDebugger.start(g:ruby_debugger_cucumber_path . ' ' . file)
elseif file =~ '_test\.rb$'
View
4 doc/ruby_debugger.txt
@@ -233,6 +233,10 @@ For this, set some variables in your .vimrc. E.g.: >
let g:ruby_debugger_spec_path = 'c:\gembins\spec' " set Rspec path
let g:ruby_debugger_cucumber_path = 'c:\gembins\cucumber' " set Cucumber path
+A single rspec test can be invoked by RdbTestSingle which will invoke rspec
+and pass the current line to rspec via "-l" argument to rspec. For Cucumber
+and Test::Unit all tests/features are run.
+
==============================================================================
RUBY 1.9 AND RAILS 3 *ruby-debugger-ruby19*
View
1  plugin/ruby_debugger.vim
@@ -19,6 +19,7 @@ command! -nargs=* -complete=file Rdebugger call ruby_debugger#load_debugger() |
command! -nargs=0 RdbStop call g:RubyDebugger.stop()
command! -nargs=1 RdbCommand call g:RubyDebugger.send_command_wrapper(<q-args>)
command! -nargs=0 RdbTest call g:RubyDebugger.run_test()
+command! -nargs=0 RdbTestSingle call g:RubyDebugger.run_test(" -l " . line("."))
command! -nargs=1 RdbEval call g:RubyDebugger.eval(<q-args>)
command! -nargs=1 RdbCond call g:RubyDebugger.conditional_breakpoint(<q-args>)
command! -nargs=1 RdbCatch call g:RubyDebugger.catch_exception(<q-args>)
View
1  src/ruby_debugger/init.vim
@@ -19,6 +19,7 @@ command! -nargs=* -complete=file Rdebugger call ruby_debugger#load_debugger() |
command! -nargs=0 RdbStop call g:RubyDebugger.stop()
command! -nargs=1 RdbCommand call g:RubyDebugger.send_command_wrapper(<q-args>)
command! -nargs=0 RdbTest call g:RubyDebugger.run_test()
+command! -nargs=0 RdbTestSingle call g:RubyDebugger.run_test(" -l " . line("."))
command! -nargs=1 RdbEval call g:RubyDebugger.eval(<q-args>)
command! -nargs=1 RdbCond call g:RubyDebugger.conditional_breakpoint(<q-args>)
command! -nargs=1 RdbCatch call g:RubyDebugger.catch_exception(<q-args>)
View
5 src/ruby_debugger/public.vim
@@ -260,10 +260,11 @@ endfunction
" Debug current opened test
-function! RubyDebugger.run_test() dict
+function! RubyDebugger.run_test(...) dict
let file = s:get_filename()
if file =~ '_spec\.rb$'
- call g:RubyDebugger.start(g:ruby_debugger_spec_path . ' ' . file)
+ let line = a:0 && a:0 > 0 && !empty(a:1) ? a:1 : " "
+ call g:RubyDebugger.start(g:ruby_debugger_spec_path . ' ' . file . line)
elseif file =~ '\.feature$'
call g:RubyDebugger.start(g:ruby_debugger_cucumber_path . ' ' . file)
elseif file =~ '_test\.rb$'
Please sign in to comment.
Something went wrong with that request. Please try again.