Sha256: 3385e4c795436baf427c964cdeca032cb1e3197de06f6ad58a6ffccbd71bca0f

Contents?: true

Size: 998 Bytes

Versions: 5

Compression:

Stored size: 998 Bytes

Contents

# encoding: utf-8
require 'test_helper'

module PolishInvoicer
  class WriterTest < MiniTest::Unit::TestCase
    def test_save_to_html
      invoice = create_valid_invoice
      writer = Writer.new(invoice)
      path = '/tmp/test.html'
      writer.save_to_html(path)
      assert File.exists?(path)
      File.unlink(path)
    end

    def test_save_to_pdf
      invoice = create_valid_invoice
      writer = Writer.new(invoice)
      path = '/tmp/test.pdf'
      writer.save_to_pdf(path)
      assert File.exists?(path)
      File.unlink(path)
    end

    def test_setting_additional_params
      invoice = create_valid_invoice
      invoice.template_path = 'tpl.slim'
      invoice.logger = 'FakeLogger'
      invoice.wkhtmltopdf_command = 'wkhtmltopdf_fake_command'
      writer = Writer.new(invoice)
      assert_equal 'tpl.slim', writer.template_path
      assert_equal 'FakeLogger', writer.logger
      assert_equal 'wkhtmltopdf_fake_command', writer.wkhtmltopdf_command
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polish_invoicer-0.0.5 test/writer_test.rb
polish_invoicer-0.0.4 test/writer_test.rb
polish_invoicer-0.0.3 test/writer_test.rb
polish_invoicer-0.0.2 test/writer_test.rb
polish_invoicer-0.0.1 test/writer_test.rb