mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Let irb use an empty file as irbrc
to get rid of side-effect by existing .irbrc file.
This commit is contained in:
parent
b632566d33
commit
8b39df854d
2 changed files with 3 additions and 1 deletions
1
spec/ruby/core/binding/fixtures/irbrc
Normal file
1
spec/ruby/core/binding/fixtures/irbrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# empty configuration
|
|
@ -4,8 +4,9 @@ ruby_version_is "2.5" do
|
||||||
describe "Binding#irb" do
|
describe "Binding#irb" do
|
||||||
it "creates an IRB session with the binding in scope" do
|
it "creates an IRB session with the binding in scope" do
|
||||||
irb_fixture = fixture __FILE__, "irb.rb"
|
irb_fixture = fixture __FILE__, "irb.rb"
|
||||||
|
irbrc_fixture = fixture __FILE__, "irbrc"
|
||||||
|
|
||||||
out = IO.popen([*ruby_exe, irb_fixture], "r+") do |pipe|
|
out = IO.popen([{"IRBRC"=>irbrc_fixture}, *ruby_exe, irb_fixture], "r+") do |pipe|
|
||||||
pipe.puts "a ** 2"
|
pipe.puts "a ** 2"
|
||||||
pipe.puts "exit"
|
pipe.puts "exit"
|
||||||
pipe.readlines.map(&:chomp)
|
pipe.readlines.map(&:chomp)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue