Skip to content

Commit 8cccd90

Browse files
committed
More
1 parent 2c049bb commit 8cccd90

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

test/rdoc/end_to_end/helper.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'fileutils'
2+
require 'open3'
23
require_relative '../xref_test_case'
34

45
class Helper
@@ -22,11 +23,17 @@ def self.run_rdoc(markup, method)
2223
rdoc_filename = filestem + '.rdoc'
2324
File.write(rdoc_filename, markup)
2425
# Run rdoc, to create the HTML file.
25-
html_dirname = 'html'
26-
`rdoc --op html #{rdoc_filename} #{html_dirname}`
26+
command = "rdoc #{rdoc_filename + 'xxx'}"
27+
puts command
28+
Open3.popen3(command) do |_, stdout, stderr|
29+
stdout_s = stdout.read
30+
raise RuntimeError.new(stdout_s) unless stdout_s.match('Parsing')
31+
stderr_s = stderr.read
32+
raise RuntimeError.new(stderr_s) unless stderr_s.match('Generating')
33+
end
2734
# Get the HTML as lines.
2835
html_filename = filestem + '_rdoc.html'
29-
html_filepath = File.join(html_dirname, html_filename)
36+
html_filepath = File.join('doc', html_filename)
3037
html_lines = File.readlines(html_filepath)
3138
# Yield them.
3239
yield html_lines

0 commit comments

Comments
 (0)