summaryrefslogtreecommitdiff
path: root/test/irb/test_workspace.rb
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2022-11-03 22:13:07 +0000
committergit <svn-admin@ruby-lang.org>2022-11-03 22:13:11 +0000
commita9232038119f2401e6c3d3a4946114b1e878afb5 (patch)
tree14465474a9e8aa589bd793d42d96dfbd58c91214 /test/irb/test_workspace.rb
parenta13836e70d9cc2eb569911030cbd735d68b4042c (diff)
[ruby/irb] Provide a base test class and let tests restore encodings
conveniently (https://github.com/ruby/irb/pull/429) * Create a base TestIRB::TestCase class * Save/restore encodings for tests that initializes InputMethod classes Because `RelineInputMethod#initializes` calls `set_encoding`, which changes stdio/out/err and Encoding's default encoding values, we need to make sure any test that directly or indirectly (e.g. through Context) initializes `RelineInputMethod` restores encodings. `ReadlineInputMethod` also changes encodings but currently no tests cover it. * Remove unnecessary TestHelper module Since we now have a base TestCase, without_rdoc can just live there. https://github.com/ruby/irb/commit/c2874ec121
Diffstat (limited to 'test/irb/test_workspace.rb')
-rw-r--r--test/irb/test_workspace.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb
index 1a1dc1f49b..9b10c27b89 100644
--- a/test/irb/test_workspace.rb
+++ b/test/irb/test_workspace.rb
@@ -1,13 +1,14 @@
# frozen_string_literal: false
-require 'test/unit'
require 'tempfile'
require 'rubygems'
require 'irb'
require 'irb/workspace'
require 'irb/color'
+require_relative "helper"
+
module TestIRB
- class TestWorkSpace < Test::Unit::TestCase
+ class TestWorkSpace < TestCase
def test_code_around_binding
IRB.conf[:USE_COLORIZE] = false
Tempfile.create('irb') do |f|