Skip to content

Commit 8fea19e

Browse files
committed
Encoding is always provided on Ruby 1.9 or later.
1 parent 923ba93 commit 8fea19e

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

lib/rdoc/markup/parser.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def initialize
7979
@binary_input = nil
8080
@current_token = nil
8181
@debug = false
82-
@have_encoding = Object.const_defined? :Encoding
8382
@input = nil
8483
@input_encoding = nil
8584
@line = 0

lib/rdoc/test_case.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ def setup
3939

4040
@top_level = nil
4141

42-
@have_encoding = Object.const_defined? :Encoding
43-
4442
@RM = RDoc::Markup
4543

4644
RDoc::Markup::PreProcess.reset

test/test_rdoc_markup_parser.rb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ def test_char_pos
2828

2929
s.scan(/\S+/)
3030

31-
if @have_encoding then
32-
assert_equal 3, parser.char_pos(s.pos)
33-
else
34-
assert_equal 4, parser.char_pos(s.pos)
35-
end
31+
assert_equal 3, parser.char_pos(s.pos)
3632
end
3733

3834
def test_get
@@ -1358,8 +1354,6 @@ def test_tokenize_note_newline
13581354
end
13591355

13601356
def test_tokenize_note_utf_8
1361-
skip 'Encoding not implemented' unless @have_encoding
1362-
13631357
str = <<-STR
13641358
cät:: l1a
13651359
l1b
@@ -1624,11 +1618,7 @@ def test_token_pos
16241618

16251619
s.scan(/\S+/)
16261620

1627-
if @have_encoding then
1628-
assert_equal [3, 0], parser.token_pos(s.pos)
1629-
else
1630-
assert_equal [4, 0], parser.token_pos(s.pos)
1631-
end
1621+
assert_equal [3, 0], parser.token_pos(s.pos)
16321622
end
16331623

16341624
# HACK move to Verbatim test case

0 commit comments

Comments
 (0)