Sha256: 5798c9537b2f0cdd80b8e1b2e100f2d7f7610d868f0233bd6c7b1fc6c64e0fac

Contents?: true

Size: 716 Bytes

Versions: 6

Compression:

Stored size: 716 Bytes

Contents

require 'test_helper'
require 'json'

class TestSpec < Minitest::Test
  spec = open_spec_file('spec.txt', normalize: true)

  spec.each do |testcase|
    # next unless testcase['example'] == 420
    doc = CommonMarker.render_doc(testcase[:markdown])

    define_method("test_to_html_example_#{testcase[:example]}") do
      actual = doc.to_html.rstrip
      assert_equal testcase[:html], actual, testcase[:markdown]
    end

    define_method("test_html_renderer_example_#{testcase[:example]}") do
      actual = HtmlRenderer.new.render(doc).rstrip
      File.write('test.txt', testcase[:html])
      File.write('actual.txt', actual)
      assert_equal testcase[:html], actual, testcase[:markdown]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
commonmarker-0.6.0 test/test_spec.rb
commonmarker-0.5.1 test/test_spec.rb
commonmarker-0.5.0 test/test_spec.rb
commonmarker-0.4.1 test/test_spec.rb
commonmarker-0.4.0 test/test_spec.rb
commonmarker-0.3.0 test/test_spec.rb