Mostly from wen heping. Minor changes by me to not add a dependency when one is not needed with any of the Ruby versions in ports.
27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
$OpenBSD: patch-test_run_tests_rb,v 1.2 2020/08/21 21:22:27 jeremy Exp $
|
|
|
|
Fix tests so they run.
|
|
|
|
Index: test/run_tests.rb
|
|
--- test/run_tests.rb.orig
|
|
+++ test/run_tests.rb
|
|
@@ -32,9 +32,9 @@ Dir[arg].each {|f| fwidth = [fwidth, f.length + 10].ma
|
|
html_file = file.sub('.text', '.html')
|
|
opts_file = file.sub('.text', '.options')
|
|
opts_file = File.join(File.dirname(file), 'options') unless File.exist?(opts_file)
|
|
- options = File.exist?(opts_file) ? YAML.safe_load(File.read(opts_file)) : {auto_ids: false, footnote_nr: 1}
|
|
- doc = Kramdown::Document.new(File.read(file), options)
|
|
begin
|
|
+ options = File.exist?(opts_file) ? YAML.safe_load(File.read(opts_file)) : {auto_ids: false, footnote_nr: 1}
|
|
+ doc = Kramdown::Document.new(File.read(file), options)
|
|
assert_equal(File.read(html_file), doc.to_html)
|
|
puts 'PASSED'
|
|
rescue StandardError
|
|
@@ -42,5 +42,5 @@ Dir[arg].each {|f| fwidth = [fwidth, f.length + 10].ma
|
|
puts $!.message if $VERBOSE
|
|
puts $!.backtrace if $DEBUG
|
|
end
|
|
- puts "Warnings:\n" + doc.warnings.join("\n") if !doc.warnings.empty? && $VERBOSE
|
|
+ puts "Warnings:\n" + doc.warnings.join("\n") if doc && !doc.warnings.empty? && $VERBOSE
|
|
end
|