Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use just IRB for debugging #855

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions aruba.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "json", "~> 2.1"
spec.add_development_dependency "kramdown", "~> 2.1"
spec.add_development_dependency "minitest", "~> 5.10"
spec.add_development_dependency "pry", [">= 0.13.0", "< 0.15.0"]
spec.add_development_dependency "pry-doc", "~> 1.0"
spec.add_development_dependency "rake", [">= 12.0", "< 14.0"]
spec.add_development_dependency "rake-manifest", "~> 0.2.0"
spec.add_development_dependency "rspec", "~> 3.10.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@ Feature: Debug your command in cucumber-test-run
Given I use a fixture named "cli-app"
And the default aruba exit timeout is 60 seconds

@unsupported-on-platform-java
Scenario: You can use a debug repl in your cli program

If you want to debug an error, which only occurs in one of your
`cucumber`-tests, the `@debug`-tag becomes handy. This will use the
DebugProcess runner, making your program use the default stdin, stdout and
stderr streams so you can interact with it directly.

This will, for example, make `binding.pry` and `byebug` work in your
program. However, Aruba steps that access the input and output of your
program will not work.
This will, for example, make `binding.irb` work in your program. However,
Aruba steps that access the input and output of your program will not work.

Please make sure, that there's a statement after the `binding.pry`-call.
Otherwise you might not get an interactive shell, because your program will
just exit.
Please make sure, that there's a statement after the statement starting the
debugger. Otherwise you might not get an interactive shell, because your
program will just exit.

We are going to demonstrate this using `pry`, but any other interactive
We are going to demonstrate this using `irb`, but any other interactive
debugger for any other programming language should also work.

Given an executable named "bin/aruba-test-cli" with:
Expand All @@ -35,8 +33,7 @@ Feature: Debug your command in cucumber-test-run

foo = 'hello'

require 'pry'
binding.pry
binding.irb

exit 0
"""
Expand All @@ -53,11 +50,15 @@ Feature: Debug your command in cucumber-test-run
And I type "foo"
And I type "exit"
Then the output should contain:
"""
[1] pry(main)> foo
=> "hello"
[2] pry(main)> exit
"""
"""
=> 8: binding.irb
9:
10: exit 0
Switch to inspect mode.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There doesn't seem to be much we can do about this. Maybe we should keep pry around for now and just drop byebug.

foo
"hello"
exit
"""

Scenario: Can handle announcers
Given an executable named "bin/aruba-test-cli" with:
Expand Down
4 changes: 0 additions & 4 deletions fixtures/cli-app/script/console
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ require "cli/app"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
IRB.start
3 changes: 0 additions & 3 deletions spec/support/configs/pry.rb

This file was deleted.