Sha256: 4f146ed15a2fbc65b847ea623a15da3f76c9d31c73a54e48db030fca204d9874

Contents?: true

Size: 670 Bytes

Versions: 20

Compression:

Stored size: 670 Bytes

Contents

require 'test_helper'
require 'nokogiri'

class Mathematical::MathJaxTest < MiniTest::Test

  render_svg = Mathematical.new

  SKIPPED = []
  Dir["#{MATHJAX_TEX_DIR}/**/*.txt"].each do |tex|
    define_method "test_#{tex}" do
      tex_contents = File.read(tex)
      data = nil

      assert_silent do
        data = render_svg.render(tex_contents)
      end

      write_sample(tex_contents, File.basename(tex, '.txt')) if ENV['MATHEMATICAL_GENERATE_SAMPLE']

      # assert the SVG actually rendered
      doc = Nokogiri::HTML(data[:data])
      assert_empty doc.search(%(//svg[@width='0pt']))
      assert_empty doc.search(%(//svg[@height='0pt']))
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mathematical-1.6.14 test/mathematical/mathjax_test.rb
mathematical-1.6.13 test/mathematical/mathjax_test.rb
mathematical-1.6.12 test/mathematical/mathjax_test.rb
mathematical-1.6.11 test/mathematical/mathjax_test.rb
mathematical-1.6.10 test/mathematical/mathjax_test.rb
mathematical-1.6.9 test/mathematical/mathjax_test.rb
mathematical-1.6.8 test/mathematical/mathjax_test.rb
mathematical-1.6.7 test/mathematical/mathjax_test.rb
mathematical-1.6.6 test/mathematical/mathjax_test.rb
mathematical-1.6.5 test/mathematical/mathjax_test.rb
mathematical-1.6.4 test/mathematical/mathjax_test.rb
mathematical-1.6.3 test/mathematical/mathjax_test.rb
mathematical-1.6.2 test/mathematical/mathjax_test.rb
mathematical-1.6.1 test/mathematical/mathjax_test.rb
mathematical-1.6.0 test/mathematical/mathjax_test.rb
mathematical-1.5.12 test/mathematical/mathjax_test.rb
mathematical-1.5.0 test/mathematical/mathjax_test.rb
mathematical-1.4.2 test/mathematical/mathjax_test.rb
mathematical-1.4.1 test/mathematical/mathjax_test.rb
mathematical-1.4.0 test/mathematical/mathjax_test.rb