Skip to content

Commit

Permalink
Remove and Restore irb configuration like irbrc while irb console tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jan 22, 2024
1 parent 61de9d8 commit 91fe870
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/console/irb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ module DEBUGGER__
class IrbTest < ConsoleTestCase
def setup
@original_pager = ENV["PAGER"]
@original_home = ENV["HOME"]
@original_xdg_config_home = ENV["XDG_CONFIG_HOME"]
@original_irbrc = ENV["IRBRC"]

ENV["PAGER"] = "cat"
ENV["HOME"] = ENV["XDG_CONFIG_HOME"] = Dir.mktmpdir
ENV["IRBRC"] = nil
end

def teardown
ENV["PAGER"] = @original_pager
ENV["HOME"] = @original_home
ENV["XDG_CONFIG_HOME"] = @original_xdg_config_home
ENV["IRBRC"] = @original_irbrc
end

def program
Expand Down

0 comments on commit 91fe870

Please sign in to comment.