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.2.1 spec/integration_spec.rb
polytexnic-1.2.0 spec/integration_spec.rb
polytexnic-1.1.14 spec/integration_spec.rb
polytexnic-1.1.11 spec/integration_spec.rb
polytexnic-1.1.10 spec/integration_spec.rb
polytexnic-1.1.9 spec/integration_spec.rb
polytexnic-1.1.8 spec/integration_spec.rb
polytexnic-1.1.7 spec/integration_spec.rb
polytexnic-1.1.6 spec/integration_spec.rb
polytexnic-1.1.5 spec/integration_spec.rb
polytexnic-1.1.4 spec/integration_spec.rb
polytexnic-1.1.3 spec/integration_spec.rb
polytexnic-1.1.2 spec/integration_spec.rb
polytexnic-1.1.1 spec/integration_spec.rb
polytexnic-1.1.0 spec/integration_spec.rb
polytexnic-1.1.beta2 spec/integration_spec.rb
polytexnic-1.0.4 spec/integration_spec.rb
polytexnic-1.0.3 spec/integration_spec.rb
polytexnic-1.1.beta1 spec/integration_spec.rb
polytexnic-1.0.2 spec/integration_spec.rb