Sha256: 894b8a02ce60c59270f6ebfa50e62dddb52d62825d705c7f9d8ecdb0a049ced2

Contents?: true

Size: 912 Bytes

Versions: 127

Compression:

Stored size: 912 Bytes

Contents

# encoding=utf-8
require 'spec_helper'

# Returns a list of fixture filenames.
def filenames
  %w[inline_math verbatim_environments math_environments]
end

# Returns the results of converting the TeX filename to HTML.
def converted(filename)
  Polytexnic::Pipeline.new(contents(filename, 'tex')).to_html
end

# Returns the contents of the HTML filename fixture.
def html(filename)
  contents(filename, 'html')
end

# Returns the contents of a filename using its extension.
def contents(filename, extension)
  File.open(File.join('spec', 'fixtures', "#{filename}.#{extension}")).read
end

describe Polytexnic::Pipeline do

  filenames.each do |filename|
    it "should correctly process #{filename}" do
      tmp = 'tmp'
      File.mkdir(tmp) unless File.directory?(tmp)
      File.write(File.join(tmp, filename), converted(filename))
      expect(converted(filename)).to resemble html(filename)
    end
  end
end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
polytexnic-1.10.8 spec/integration_spec.rb
polytexnic-1.10.7 spec/integration_spec.rb
polytexnic-1.10.6 spec/integration_spec.rb
polytexnic-1.10.5 spec/integration_spec.rb
polytexnic-1.10.4 spec/integration_spec.rb
polytexnic-1.10.3 spec/integration_spec.rb
polytexnic-1.10.2 spec/integration_spec.rb
polytexnic-1.10.1 spec/integration_spec.rb
polytexnic-1.10.0 spec/integration_spec.rb
polytexnic-1.9.2 spec/integration_spec.rb
polytexnic-1.9.1 spec/integration_spec.rb
polytexnic-1.9.0 spec/integration_spec.rb
polytexnic-1.8.2 spec/integration_spec.rb
polytexnic-1.8.1 spec/integration_spec.rb
polytexnic-1.8.0 spec/integration_spec.rb
polytexnic-1.7.5 spec/integration_spec.rb
polytexnic-1.7.4 spec/integration_spec.rb
polytexnic-1.7.3 spec/integration_spec.rb
polytexnic-1.7.2 spec/integration_spec.rb
polytexnic-1.7.1 spec/integration_spec.rb