File: test_setup.rb

package info (click to toggle)
ruby-multi-xml 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 472 kB
  • sloc: ruby: 2,822; sh: 4; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 461 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Shared setup that configures the parser backend before each test
module ParserTestSetup
  def self.included(base)
    base.extend(Mutant::Minitest::Coverage)
    base.cover("MultiXml*")
  end

  def setup
    MultiXml.parser = self.class::PARSER
    LibXML::XML::Error.set_handler(&LibXML::XML::Error::QUIET_HANDLER) if %w[LibXML libxml_sax].include?(self.class::PARSER)
  rescue LoadError
    skip "Parser #{self.class::PARSER} couldn't be loaded"
  end
end