Sha256: ced4aa7c826ead6f44569b0a4c44ca6ef25b0a88f5dffb4b02f8a152521fe89f

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

require 'test_helper'

class WkHtmlToPdfTest < Test::Unit::TestCase
  def test_right_backend_is_picked
    assert_equal Documentalist.backend_for_conversion("test.html", "test.pdf"),
      Documentalist::WkHtmlToPdf,
      "Wrong backend picked"
  end

  def test_conversion
    temp_file = File.join(Dir.tmpdir, "#{rand(10**9)}.pdf")

    Documentalist.convert(fixture_002, :to => temp_file)
    assert File.exists?(temp_file), "No converted PDF created"

    assert_match /Test content/, Documentalist.extract_text(temp_file)

    FileUtils.rm temp_file
    assert !File.exists?(temp_file), "We didn't clean up properly"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
documentalist-0.1.4 test/wkhtmltopdf_test.rb
documentalist-0.1.3 test/wkhtmltopdf_test.rb
documentalist-0.1.2 test/wkhtmltopdf_test.rb