* test/rdoc/test_rdoc_ri_driver.rb (with_dummy_pager): don't grap

terminal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-02 06:26:24 +00:00
Родитель bb471e3268
Коммит cf25ae4551
2 изменённых файлов: 20 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Fri Apr 2 15:26:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/rdoc/test_rdoc_ri_driver.rb (with_dummy_pager): don't grap
terminal.
Fri Apr 2 14:43:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/rdoc.rb (RDoc::Generator): defer by autoload.

Просмотреть файл

@ -34,6 +34,15 @@ class TestRDocRIDriver < MiniTest::Unit::TestCase
FileUtils.rm_rf @tmpdir
end
DUMMY_PAGER = ":;\n"
def with_dummy_pager
pager_env, ENV['RI_PAGER'] = ENV['RI_PAGER'], DUMMY_PAGER
yield
ensure
ENV['RI_PAGER'] = pager_env
end
def mu_pp(obj)
s = ''
s = PP.pp obj, s
@ -558,10 +567,12 @@ Foo::Bar#bother
def test_page
@driver.use_stdout = false
@driver.page do |io|
skip "couldn't find a standard pager" if io == $stdout
with_dummy_pager do
@driver.page do |io|
skip "couldn't find a standard pager" if io == $stdout
assert @driver.paging?
assert @driver.paging?
end
end
refute @driver.paging?
@ -664,7 +675,7 @@ Foo::Bar#bother
def test_setup_pager
@driver.use_stdout = false
pager = @driver.setup_pager
pager = with_dummy_pager {@driver.setup_pager}
skip "couldn't find a standard pager" unless pager