From cf25ae4551f623121b9047e1c94a872583b545aa Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 2 Apr 2010 06:26:24 +0000 Subject: * 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 --- test/rdoc/test_rdoc_ri_driver.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'test/rdoc') diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb index 27b59eb811..c41a130e77 100644 --- a/test/rdoc/test_rdoc_ri_driver.rb +++ b/test/rdoc/test_rdoc_ri_driver.rb @@ -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 -- cgit v1.2.3