We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Binding#irb
1 parent 2a9687b commit 217b51eCopy full SHA for 217b51e
spec/ruby/core/binding/fixtures/irb.rb
@@ -0,0 +1,3 @@
1
+a = 10
2
+
3
+binding.irb
spec/ruby/core/binding/irb_spec.rb
@@ -0,0 +1,17 @@
+require_relative '../../spec_helper'
+ruby_version_is "2.5" do
4
+ describe "Binding#irb" do
5
+ it "creates an IRB session with the binding in scope" do
6
+ irb_fixture = fixture __FILE__, "irb.rb"
7
8
+ out = IO.popen([*ruby_exe, irb_fixture], "r+") do |pipe|
9
+ pipe.puts "a ** 2"
10
+ pipe.puts "exit"
11
+ pipe.readlines.map(&:chomp)
12
+ end
13
14
+ out[-3..-1].should == ["a ** 2", "100", "exit"]
15
16
17
+end
0 commit comments