Skip to content

Commit

Permalink
Prevent a warning: setting Encoding.default_external (#810)
Browse files Browse the repository at this point in the history
* Prevent a warning: setting Encoding.default_external

* Save $VERBOSE properly

---------

Co-authored-by: Nobuyoshi Nakada <[email protected]>
  • Loading branch information
mame and nobu authored Dec 12, 2023
1 parent 2cccc44 commit 3436bdc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/irb/test_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def test_history_concurrent_use_not_present
def test_history_different_encodings
backup_default_external = Encoding.default_external
IRB.conf[:SAVE_HISTORY] = 2
verbose_bak, $VERBOSE = $VERBOSE, nil
Encoding.default_external = Encoding::US_ASCII
locale = IRB::Locale.new("C")
assert_history(<<~EXPECTED_HISTORY.encode(Encoding::US_ASCII), <<~INITIAL_HISTORY.encode(Encoding::UTF_8), <<~INPUT, locale: locale)
Expand All @@ -163,6 +164,7 @@ def test_history_different_encodings
INPUT
ensure
Encoding.default_external = backup_default_external
$VERBOSE = verbose_bak
end

private
Expand Down

0 comments on commit 3436bdc

Please sign in to comment.