Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8507529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:53:52+00:00 2026-06-11T02:53:52+00:00

How does one launch irb during the runtime of my rspec tests? Essentially I

  • 0

How does one launch irb during the runtime of my rspec tests?

Essentially I would like to be able to play with various things and then have my rspec test run on the according instance of the program. I am able to successfully do this during conventional runtime of the program, however I run into issues when I attempt to launch irb during runtime of an rspec test.

conventional runtime

test.rb

#!/usr/bin/env ruby
require 'irb'

puts 'hello world'
IRB.start
puts 'goodbye world'

runtime

$ ./test.rb 
hello world
1.9.3-p194 :001 > puts 'yo'
yo
 => nil 
1.9.3-p194 :002 > exit
goodbye world

rspec runtime

test_spec.rb

require 'spec_helper'
require 'irb'

describe "irb" do
  it "should print 'hello world', launch irb, upon exiting irb print 'goodbye world'" do
    puts 'hello world'
    IRB.start
    puts 'goodbye world'
  end
end

runtime

$ rake spec
/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec ./spec/test_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
hello world
1.9.3p194 :001 > require 'spec_helper'
 => false
1.9.3p194 :002 > require 'irb'
 => false
1.9.3p194 :003 >
1.9.3p194 :004 >   describe "irb" do
1.9.3p194 :005 >       it "should print 'hello world', launch irb, upon exiting irb print 'goodbye world'" do
1.9.3p194 :006 >           puts 'hello world'
1.9.3p194 :007?>         IRB.start
1.9.3p194 :008?>         puts 'goodbye world'
1.9.3p194 :009?>       end
1.9.3p194 :010?>   end1.9.3p194 :010?>
 => RSpec::Core::ExampleGroup::Nested_2
1.9.3p194 :010 >
goodbye world
.

Finished in 0.10321 seconds
1 example, 0 failures

Randomized with seed 62613
$
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:53:54+00:00Added an answer on June 11, 2026 at 2:53 am

    Use pry.

    Simple, fast, with syntax highlighting. After install, you just need to write:

    binding.pry
    

    in your code to stop executing and display developer debugging console

    After you fall in love with pry, there is also useful gem called ‘pry-nav’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListActivity and a MapActivity. I would like to launch either one
I am using multiple controller during launch of an application in app delegate. One
I would like to try and make a Notification that does not respond to
How does one create and launch process (i.e. launch an .exe file) with RAM
I would like a batch file to launch two separate programs then have the
I'd like to be able to launch a ClickOnce application on a users desktop
One of our system finally launch in production and during the peak hour (about
How does one enable the loader when using ext.application? Ext.application({ name: 'App', launch: function
does one perform better over the other in terms of indexing/quering etc ? e.g.
How does one wait until all of the Javascript is loaded before curling a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.