How can i debug cucumber steps in RubyMine?

763 views
Skip to first unread message

Александра Литвиненко

unread,
Dec 31, 2013, 3:45:52 AM12/31/13
to cu...@googlegroups.com
HI. Help me
i have test on the RoR and Cucumber
I use RubyMine
I want to see all steps when i run cucumber steps. i set up breakpoints and i did not know how can i see what method run inside my features step. i want to see what functional methods are called and what processes are running

Rob Park

unread,
Dec 31, 2013, 7:58:51 AM12/31/13
to cu...@googlegroups.com
First, I always make sure I can /run/ the feature (pass or fail) from within RM.
If it will run from within RM, then debug in RM will stop on any breakpoints you've set.

If you're having trouble getting it to run inside RM, make sure it runs at all from the command line.
If it runs from the command line, then it's usually just a matter of monkeying with the "run configuration" inside of RM.

Good luck!

@robpark

Александра Литвиненко

unread,
Dec 31, 2013, 3:11:06 PM12/31/13
to cu...@googlegroups.com
i can run the features from within RM, but when i set up the breakpoint(set in .rb) and run. there are nothing happened.  message(breakpoint was set in line) is displayed in console but the test don't stop in breakpoints.And i don't know what need to set up in RM. 


Rob Park

unread,
Dec 31, 2013, 3:51:06 PM12/31/13
to cu...@googlegroups.com
On Tue, Dec 31, 2013 at 3:11 PM, Александра Литвиненко <karue...@gmail.com> wrote:
i can run the features from within RM, but when i set up the breakpoint(set in .rb) and run.


When you say "and run" are you selecting debug from the run menu?
If yes, then that's weird and you may need to ask JetBrains for more info.

 
there are nothing happened.  message(breakpoint was set in line) is displayed in console but the test don't stop in breakpoints.And i don't know what need to set up in RM. 


I'm also assuming that your breakpoint is in the Cucumber code? Not in your Rails app. 

Oleg Sukhodolsky

unread,
Jan 1, 2014, 2:43:21 AM1/1/14
to cu...@googlegroups.com, cu...@googlegroups.com


On 01 янв. 2014 г., at 0:11, Александра Литвиненко <karue...@gmail.com> wrote:

i can run the features from within RM, but when i set up the breakpoint(set in .rb) and run. there are nothing happened.  message(breakpoint was set in line) is displayed in console but the test don't stop in breakpoints.And i don't know what need to set up in RM. 



Debugging is supposed to work after steps you described.   And debugger should stop on breakpoints (of course if the code is executed).  I'd suggest to file a bug in RM's tracker with rube version and (preferably) the test provided.

Oleg

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Александра Литвиненко

unread,
Jan 4, 2014, 11:39:15 AM1/4/14
to cu...@googlegroups.com
i update RM to 6.0.2
i do:
1. install debug gem with:
    gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
    gem 'ruby-debug-base19x', '~> 0.11.30.pre4'
    gem 'ruby-debug19'

2. I set up the "debug ":
When /^I press "([^\"]*)"$/ do |button|
    puts current_url
    debugger
    click_button(button)
end


1. when i run => "debug"  from the run menu (debug gem was installed for RM) i have the error :
/home/alex/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/thread.rb:71:in `sleep': deadlock detected (fatal)
    from /home/alex/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/thread.rb:71:in `wait'
    from /home/alex/.rvm/gems/ruby-1.9.3-p374@blog/gems/ruby-debug-ide-0.4.22/lib/ruby-debug-ide.rb:78:in `block in prepare_debugger'
    from <internal:prelude>:10:in `synchronize'


2. when i run features(from console and run from RM) and i have error:
INTERNAL ERROR!!! undefined method `line_at' for Debugger:Module
    /home/alex/.rvm/gems/ruby-1.9.3-p374@blog/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:99:in `print_location_and_text'

Александра Литвиненко

unread,
Jan 4, 2014, 2:56:45 PM1/4/14
to cu...@googlegroups.com

when i run from console
rdebug features/step_definitions/test_steps.rb
i have the same error : INTERNAL ERROR!!! undefined method `line_at' for Debugger:Module

aslak hellesoy

unread,
Jan 4, 2014, 4:35:45 PM1/4/14
to Cucumber Users

Александра Литвиненко

unread,
Jan 5, 2014, 1:41:55 AM1/5/14
to cu...@googlegroups.com
no, because he can start the debugger but i can not start the debugger.
i have error when i run  the features only, before i can call  "skip" command

aslak hellesoy

unread,
Jan 5, 2014, 5:07:02 AM1/5/14
to Cucumber Users
On Sun, Jan 5, 2014 at 6:41 AM, Александра Литвиненко <karue...@gmail.com> wrote:
no, because he can start the debugger but i can not start the debugger.
i have error when i run  the features only, before i can call  "skip" command


I'm not sure what question you're replying to here. Can you please use inline posting as explained in the posting rules?

Aslak 
Message has been deleted

Александра Литвиненко

unread,
Jan 5, 2014, 6:33:06 AM1/5/14
to cu...@googlegroups.com

Rob Park

unread,
Jan 5, 2014, 8:15:18 AM1/5/14
to cu...@googlegroups.com
On Sat, Jan 4, 2014 at 11:39 AM, Александра Литвиненко <karue...@gmail.com> wrote:
i update RM to 6.0.2
i do:
1. install debug gem with:
    gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
    gem 'ruby-debug-base19x', '~> 0.11.30.pre4'
    gem 'ruby-debug19'

2. I set up the "debug ":
When /^I press "([^\"]*)"$/ do |button|
    puts current_url
    debugger
    click_button(button)
end


1. when i run => "debug"  from the run menu (debug gem was installed for RM) i have the error :
/home/alex/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/thread.rb:71:in `sleep': deadlock detected (fatal)
    from /home/alex/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/thread.rb:71:in `wait'
    from /home/alex/.rvm/gems/ruby-1.9.3-p374@blog/gems/ruby-debug-ide-0.4.22/lib/ruby-debug-ide.rb:78:in `block in prepare_debugger'
    from <internal:prelude>:10:in `synchronize'


2. when i run features(from console and run from RM) and i have error:

INTERNAL ERROR!!! undefined method `line_at' for Debugger:Module
    /home/alex/.rvm/gems/ruby-1.9.3-p374@blog/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:99:in `print_location_and_text'

When trying to debug with RubyMine, don't use the ruby debugger gem.
Use the built in RubyMine debugger.
Reply all
Reply to author
Forward
0 new messages