Commit graph

8 commits

Author SHA1 Message Date
Stan Lo
a923203811 [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.

c2874ec121
2022-11-03 22:13:11 +00:00
Peter Zhu
73a0223f95 [ruby/irb] Rename test_helper.rb to helper.rb
The name test_helper.rb conflicts with the test_helper.rb in JSON,
causing build failures. This commit renames test_helper.rb to helper.rb.

b6a92bf6b3

Co-Authored-By: Stan Lo <stan001212@gmail.com>
2022-10-26 15:13:44 +00:00
st0012
cb95d834cc [ruby/irb] Don't insert new methods to Test::Unit::TestCase
Ruby CI runs irb and other Ruby core/stdlib tests in the same process.
So adding irb-specific helper to Test::Unit::TestCase could potentially
pollute other components' tests and should be avoided.
2022-10-26 10:44:29 -04:00
st0012
40f8a781a3 [ruby/irb] Extract without_rdoc helper 2022-10-26 10:44:03 -04:00
Stan Lo
48339d5c5b [ruby/irb] Make sure Encoding's defaults are restored 2022-10-25 20:50:07 +00:00
Stan Lo
abeef41c95 [ruby/irb] Restore standard input/output encodings after input method tests 2022-10-24 17:02:34 +00:00
st0012
5a86155249 [ruby/irb] Add a test case to cover rdoc unintalled scenario 2022-10-24 13:36:58 +00:00
st0012
d377cc4530 [ruby/irb] Add tests for RelineInputMethod 2022-10-24 13:36:56 +00:00