Skip to content

Commit 9c4cb93

Browse files
authored
Merge pull request #525 from aycabta/clean-warnings-in-tests
Clean warnings in tests
2 parents 1152955 + 0ee0e6d commit 9c4cb93

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/test_rdoc_parser_ruby.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,13 @@ def test_parse_class_stopdoc
778778

779779
def test_parse_class_lower_name_warning
780780
@options.verbosity = 2
781-
out, err = capture_io do
781+
stds = capture_io do
782782
util_parser "class foo\nend"
783783
tk = @parser.get_tk
784784
@parser.parse_class @top_level, RDoc::Parser::Ruby::NORMAL, tk, @comment
785785
end
786-
assert_match /Expected class name or '<<'\. Got/, err
786+
err = stds[1]
787+
assert_match(/Expected class name or '<<'\. Got/, err)
787788
end
788789

789790
def test_parse_multi_ghost_methods
@@ -1379,8 +1380,6 @@ class Klass3
13791380
klass = @store.find_class_named 'Klass'
13801381
klass2 = @store.find_class_named 'Klass2'
13811382
klass3 = @store.find_class_named 'Klass3'
1382-
constant = klass2.find_module_named 'CONSTANT'
1383-
constant2 = klass3.find_module_named 'CONSTANT_2'
13841383
assert_equal klass, klass2.constants.first.is_alias_for
13851384
refute_equal klass, klass3.constants.first.is_alias_for
13861385
assert_nil klass3.find_module_named 'CONSTANT_2'
@@ -3639,7 +3638,7 @@ class C
36393638
@parser.scan
36403639

36413640
c = @store.find_class_named 'C'
3642-
const_a, const_b, const_c, const_d = c.constants.sort_by(&:name)
3641+
const_a, const_b, const_c = c.constants.sort_by(&:name)
36433642

36443643
assert_equal 'CONST_A', const_a.name
36453644
assert_equal :public, const_a.visibility

0 commit comments

Comments
 (0)