Sha256: e8a2e2a6a50a1adfb40250ba9a139aeed8d889bc816b6c2d285bf665a467fa55

Contents?: true

Size: 941 Bytes

Versions: 19

Compression:

Stored size: 941 Bytes

Contents

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/recipe.docx"
    @template_path = @base_path + "fixtures/recipe_template.docx"
    @sample_path = @base_path + "fixtures/recipe_sample.docx"
    @context_path = @base_path + "fixtures/recipe_context.json"
    @executable_path = @base_path + '../exe/sablon'
    @output_path.delete if @output_path.exist?
  end

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

    assert_docx_equal @sample_path, @output_path
  end

  def test_generate_document_from_template_output_to_stdout
    `cat #{@context_path} | #{@executable_path} #{@template_path} > #{@output_path}`

    assert_docx_equal @sample_path, @output_path
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sablon-0.1.1 test/executable_test.rb
sablon-0.1.0 test/executable_test.rb
sablon-0.0.22 test/executable_test.rb
sablon-0.0.21 test/executable_test.rb
sablon-0.0.20 test/executable_test.rb
sablon-0.0.19 test/executable_test.rb
sablon-0.0.19.beta5 test/executable_test.rb
sablon-0.0.19.beta4 test/executable_test.rb
sablon-0.0.19.beta3 test/executable_test.rb
sablon-0.0.19.beta2 test/executable_test.rb
sablon-0.0.19.beta1 test/executable_test.rb
sablon-0.0.18 test/executable_test.rb
sablon-0.0.17 test/executable_test.rb
sablon-0.0.16 test/executable_test.rb
sablon-0.0.15 test/executable_test.rb
sablon-0.0.14 test/executable_test.rb
sablon-0.0.13 test/executable_test.rb
sablon-0.0.12 test/executable_test.rb
sablon-0.0.11 test/executable_test.rb