summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 19:05:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 19:05:17 +0000
commit3d562b6873384098fb8e7ec375f36f3bf246b6c9 (patch)
treea5c52d685f87e560dde5952705edff54c87be391
parenteed6c15a21a9f843d8786254a935197502a9fccb (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb14
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 930b5eb..5ddd1ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Aug 1 04:05:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@fsij.org>
* bignum.c (big2str_karatsuba): Fix a condition of power_level.
diff --git a/test/rdoc/test_rdoc_markup_pre_process.rb b/test/rdoc/test_rdoc_markup_pre_process.rb
index 3a991a6..82ab71e 100644
--- a/test/rdoc/test_rdoc_markup_pre_process.rb
+++ b/test/rdoc/test_rdoc_markup_pre_process.rb
@@ -11,7 +11,7 @@ class TestRDocMarkupPreProcess < RDoc::TestCase
@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.
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