Sha256: 2985485d6415a9b8f3528bcc539584a0baca98a943e51d7067bc26f0a6ab83be

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

# -*- coding: utf-8 -*-
require "test_helper"

class ExecutableTest < Sablon::TestCase
  include Sablon::Test::Assertions

  def setup
    super
    @base_path = Pathname.new(File.expand_path("../", __FILE__))
    @output_path = @base_path + "sandbox/shopping_list.docx"
  end

  def test_generate_document_from_template
    template_path = @base_path + "fixtures/shopping_list_template.docx"
    context_path = @base_path + "fixtures/shopping_list_context.json"

    executable_path = @base_path + '../bin/sablon'

    `cat #{context_path} | #{executable_path} #{template_path} #{@output_path}`

    assert_docx_equal @base_path + "fixtures/shopping_list_sample.docx", @output_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sablon-0.0.5 test/executable_test.rb
sablon-0.0.4 test/executable_test.rb