1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rdoc/test_case.rb (RDoc::TestCase#verbose_capture_io):

defined for asserts of warnings.

* test/rdoc: use verbose_capture_io on asserts of warnings.
  they failed when tests was run with RUBYOPT=-W0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-11-29 07:01:46 +00:00
parent a985c5898c
commit 07b10cd59f
10 changed files with 37 additions and 15 deletions

View file

@ -1,3 +1,11 @@
Thu Nov 29 15:56:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
* lib/rdoc/test_case.rb (RDoc::TestCase#verbose_capture_io):
defined for asserts of warnings.
* test/rdoc: use verbose_capture_io on asserts of warnings.
they failed when tests was run with RUBYOPT=-W0.
Thu Nov 29 15:53:38 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/psych/extconf.rb: added --enable-bundled-libyaml option. this

View file

@ -151,6 +151,20 @@ class RDoc::TestCase < MiniTest::Unit::TestCase
@RM::Verbatim.new(*parts)
end
##
# run capture_io with setting $VERBOSE = true
def verbose_capture_io
capture_io do
begin
orig_verbose = $VERBOSE
$VERBOSE = true
yield
ensure
$VERBOSE = orig_verbose
end
end
end
end
# This hack allows autoload to work when Dir.pwd is changed for Ruby 1.8 since

View file

@ -230,7 +230,7 @@ class TestRDocContext < XrefTestCase
meth2.record_location @store.add_file 'second.rb'
meth2.comment = comment 'second'
_, err = capture_io do
_, err = verbose_capture_io do
@context.add_method meth2
end

View file

@ -126,7 +126,7 @@ class TestRDocContextSection < RDoc::TestCase
end
def test_sequence
_, err = capture_io do
_, err = verbose_capture_io do
assert_match(/\ASEC\d{5}\Z/, @s.sequence)
end

View file

@ -53,7 +53,7 @@ class TestRDocEncoding < RDoc::TestCase
contents = :junk
_, err = capture_io do
_, err = verbose_capture_io do
contents = RDoc::Encoding.read_file @tempfile.path, Encoding::US_ASCII
end
@ -104,7 +104,7 @@ class TestRDocEncoding < RDoc::TestCase
@tempfile.flush
contents = :junk
_, err = capture_io do
_, err = verbose_capture_io do
contents = RDoc::Encoding.read_file @tempfile.path, Encoding::UTF_8
end

View file

@ -45,7 +45,7 @@ class TestRDocOptions < RDoc::TestCase
def test_check_files_warn
@options.verbosity = 2
out, err = capture_io do
out, err = verbose_capture_io do
@options.files = %w[nonexistent]
@options.check_files
@ -572,7 +572,7 @@ rdoc_include:
@options.verbosity = 2
out, err = capture_io do
out, err = verbose_capture_io do
@options.warn "warnings on"
end

View file

@ -244,7 +244,7 @@ void Init_Blah(void) {
}
EOF
_, err = capture_io do
_, err = verbose_capture_io do
refute util_get_class(content, 'cDate')
end
@ -549,7 +549,7 @@ void Init_Blah(void) {
klass = nil
_, err = capture_io do
_, err = verbose_capture_io do
klass = util_get_class content, 'cDate'
end
@ -571,7 +571,7 @@ void Init_Blah(void) {
klass = nil
_, err = capture_io do
_, err = verbose_capture_io do
klass = util_get_class content, 'cDate'
end
@ -593,7 +593,7 @@ void Init_Blah(void) {
klass = nil
_, err = capture_io do
_, err = verbose_capture_io do
klass = util_get_class content, 'cDate'
end
@ -659,7 +659,7 @@ void Init_Blah(void) {
parser.missing_dependencies['y'] = ['y', :class, 'Y', 'Object', 'z']
parser.missing_dependencies['z'] = ['z', :class, 'Z', 'Object', 'y']
_, err = capture_io do
_, err = verbose_capture_io do
parser.do_missing
end

View file

@ -128,7 +128,7 @@ class TestRDocRDoc < RDoc::TestCase
files = nil
out, err = capture_io do
out, err = verbose_capture_io do
files = @rdoc.normalized_file_list %w[/dev/stdin]
end

View file

@ -16,13 +16,13 @@ class TestRDocTask < RDoc::TestCase
end
def test_inline_source
_, err = capture_io do
_, err = verbose_capture_io do
assert @t.inline_source
end
assert_equal "RDoc::Task#inline_source is deprecated\n", err
_, err = capture_io do
_, err = verbose_capture_io do
@t.inline_source = false
end

View file

@ -553,7 +553,7 @@ The comments associated with
end
def test_to_html_tt_tag_mismatch
_, err = capture_io do
_, err = verbose_capture_io do
assert_equal '<tt>hi', to_html('<tt>hi')
end