Commit afe7020d authored by KitaitiMakoto's avatar KitaitiMakoto

[BUG FIX]Switch XML backend for each Rake task

parent 1add0879
......@@ -40,12 +40,18 @@ namespace :test do
end
# TODO: Test with both REXML and Nokogiri in testing framework
%i[rexml nokogiri].each do |xml_backend|
Rake::TestTask.new "test_with_#{xml_backend}" do |task|
%w[REXML Nokogiri].each do |xml_backend|
task "set_xml_backend_#{xml_backend.downcase}" do
ENV["EPUB_PARSER_XML_BACKEND"] = xml_backend
end
Rake::TestTask.new "test_with_#{xml_backend.downcase}" do |task|
task.test_files = FileList['test/**/test_*.rb']
task.warning = true
task.options = '--no-show-detail-immediately --verbose'
EPUB::Parser::XMLDocument.backend = xml_backend
end
task "test_with_#{xml_backend.downcase}" => "set_xml_backend_#{xml_backend.downcase}"
end
task :test => [:test_with_rexml, :test_with_nokogiri]
end
......
......@@ -15,3 +15,4 @@ if ENV["PRETTY_BACKTRACE"]
end
require 'epub/parser'
EPUB::Parser::XMLDocument.backend = ENV["EPUB_PARSER_XML_BACKEND"].to_sym
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment