diff options
Diffstat (limited to 'test/rdoc/test_rdoc_rdoc.rb')
-rw-r--r-- | test/rdoc/test_rdoc_rdoc.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb index e958e5f2f6..853d7dad22 100644 --- a/test/rdoc/test_rdoc_rdoc.rb +++ b/test/rdoc/test_rdoc_rdoc.rb @@ -213,6 +213,48 @@ class TestRDocRDoc < RDoc::TestCase assert_equal expected_files, files end + def test_normalized_file_list_with_skipping_tests_enabled + files = temp_dir do |dir| + @a = File.expand_path('a.rb') + spec_dir = File.expand_path('spec') + spec_file = File.expand_path(File.join('spec', 'my_spec.rb')) + test_dir = File.expand_path('test') + test_file = File.expand_path(File.join('test', 'my_test.rb')) + FileUtils.touch @a + FileUtils.mkdir_p spec_dir + FileUtils.touch spec_file + FileUtils.mkdir_p test_dir + FileUtils.touch test_file + + @rdoc.options.skip_tests = true + @rdoc.normalized_file_list [File.realpath(dir)] + end + + files = files.map { |file, *| File.expand_path file } + assert_equal [@a], files + end + + def test_normalized_file_list_with_skipping_tests_disabled + files = temp_dir do |dir| + @a = File.expand_path('a.rb') + spec_dir = File.expand_path('spec') + @spec_file = File.expand_path(File.join('spec', 'my_spec.rb')) + test_dir = File.expand_path('test') + @test_file = File.expand_path(File.join('test', 'my_test.rb')) + FileUtils.touch @a + FileUtils.mkdir_p spec_dir + FileUtils.touch @spec_file + FileUtils.mkdir_p test_dir + FileUtils.touch @test_file + + @rdoc.options.skip_tests = false + @rdoc.normalized_file_list [File.realpath(dir)] + end + + files = files.map { |file, *| File.expand_path file } + assert_equal [@a, @spec_file, @test_file], files.sort + end + def test_parse_file @rdoc.store = RDoc::Store.new |