diff --git a/core/binding/fixtures/irbrc b/core/binding/fixtures/irbrc deleted file mode 100644 index 2bc12af2f7..0000000000 --- a/core/binding/fixtures/irbrc +++ /dev/null @@ -1 +0,0 @@ -# empty configuration diff --git a/core/binding/irb_spec.rb b/core/binding/irb_spec.rb index b3bc274f78..bc6c602a8e 100644 --- a/core/binding/irb_spec.rb +++ b/core/binding/irb_spec.rb @@ -1,11 +1,19 @@ require_relative '../../spec_helper' describe "Binding#irb" do + before :each do + @env_home = ENV["HOME"] + ENV["HOME"] = CODE_LOADING_DIR + end + + after :each do + ENV["HOME"] = @env_home + end + it "creates an IRB session with the binding in scope" do irb_fixture = fixture __FILE__, "irb.rb" - irbrc_fixture = fixture __FILE__, "irbrc" - out = IO.popen([{"IRBRC"=>irbrc_fixture}, *ruby_exe, irb_fixture], "r+") do |pipe| + out = IO.popen([*ruby_exe, irb_fixture], "r+") do |pipe| pipe.puts "a ** 2" pipe.puts "exit" pipe.readlines.map(&:chomp)