ruby-changes:30247
From: nobu <ko1@a...>
Date: Thu, 1 Aug 2013 04:05:28 +0900 (JST)
Subject: [ruby-changes:30247] nobu:r42299 (trunk): test_rdoc_markup_pre_process.rb: input tempfile
nobu 2013-08-01 04:05:17 +0900 (Thu, 01 Aug 2013) New Revision: 42299 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42299 Log: test_rdoc_markup_pre_process.rb: input tempfile * test/test_rdoc_markup_pre_process.rb (TestRDocMarkupPreProcess#setup): fix input_file_name, as the test script is not pre-processed. Modified files: trunk/ChangeLog trunk/test/rdoc/test_rdoc_markup_pre_process.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 42298) +++ ChangeLog (revision 42299) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Aug 1 04:05:06 2013 Nobuyoshi Nakada <nobu@r...> + + * test/test_rdoc_markup_pre_process.rb (TestRDocMarkupPreProcess#setup): + fix input_file_name, as the test script is not pre-processed. + Thu Aug 1 01:45:18 2013 Tanaka Akira <akr@f...> * bignum.c (big2str_karatsuba): Fix a condition of power_level. Index: test/rdoc/test_rdoc_markup_pre_process.rb =================================================================== --- test/rdoc/test_rdoc_markup_pre_process.rb (revision 42298) +++ test/rdoc/test_rdoc_markup_pre_process.rb (revision 42299) @@ -11,7 +11,7 @@ class TestRDocMarkupPreProcess < RDoc::T https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_markup_pre_process.rb#L11 @file_name = File.basename @tempfile.path @dir = File.dirname @tempfile.path - @pp = RDoc::Markup::PreProcess.new __FILE__, [@dir] + @pp = RDoc::Markup::PreProcess.new @tempfile.path, [@dir, File.dirname(__FILE__)] end def teardown @@ -72,6 +72,18 @@ contents of a string. https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_markup_pre_process.rb#L72 assert_equal expected, content end + def test_include_file_in_other_directory + content = nil + out, err = capture_io do + content = @pp.include_file "test.txt", '', nil + end + + assert_empty out + assert_empty err + + assert_equal "test file\n", content + end + def test_handle text = "# :main: M\n" out = @pp.handle text -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/