test/console.rb in console-0.2.3 vs test/console.rb in console-0.3
- old
+ new
@@ -6,10 +6,12 @@
## License: same terms as Ruby itself
require 'test/unit'
require 'console'
+Console.init_locale!
+
class ConsoleTest < ::Test::Unit::TestCase
def setup
@s = "能吞aê"
end
@@ -55,11 +57,9 @@
assert_equal "", Console.display_slice(@s, 6, 0);
assert_equal nil, Console.display_slice(@s, 6, -1);
end
def test_slice_misaligned_start_offsets_get_padded
- s = "能吞aê"
-
assert_equal "", Console.display_slice(@s, 0, 0)
assert_equal " ", Console.display_slice(@s, 0, 1)
assert_equal "能", Console.display_slice(@s, 0, 2)
assert_equal "能 ", Console.display_slice(@s, 0, 3)