Sha256: eec60ce0481c2eb68938d4cd520addebf930a73066eda3bbc9da7e6db49dfb85

Contents?: true

Size: 805 Bytes

Versions: 4

Compression:

Stored size: 805 Bytes

Contents

# encoding: utf-8
require 'test_helper'
require 'pathname'

class ComplianceTest < MiniTest::Unit::TestCase

  TEST_DIR = 'testsuite'

  Dir.glob("#{TEST_DIR}/input/*").each do |f|
    if (File.directory?("#{f}"))
      folder = File.basename(f).to_s
      Dir.glob("#{TEST_DIR}/input/#{folder}/*.kd").each do |t|
        testcase = File.basename(t)[0..-4].to_s

        define_method("test_#{testcase}") do
          kd = File.read("#{TEST_DIR}/input/#{folder}/#{testcase}.kd")
          html = File.read("#{TEST_DIR}/output/xml/#{folder}/#{testcase}.xml")

          parser = Koara::Parser.new
          document = parser.parse(kd)
          renderer = Koara::Xml::XmlRenderer.new
          document.accept(renderer)

          assert_equal(html, renderer.output)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
koara-xml-0.15.0 test/compliance_test.rb
koara-xml-0.14.0 test/compliance_test.rb
koara-xml-0.13.0 test/compliance_test.rb
koara-xml-0.12.0 test/compliance_test.rb