Sha256: 18a05057befddb75828fc788c97c0c6751b770ad01ccd248f04fe1543645c1dc

Contents?: true

Size: 631 Bytes

Versions: 28

Compression:

Stored size: 631 Bytes

Contents

module Sablon
  module Test
    module Assertions
      def assert_docx_equal(expected_path, actual_path)
        if get_document_xml(expected_path) != get_document_xml(actual_path)
          msg = <<-error
The generated document does not match the sample. Please investigate.

If the generated document is correct, the sample needs to be updated:
\t cp #{actual_path} #{expected_path}
      error
          fail msg
        end
      end

      def get_document_xml(path)
        document_xml_entry = Zip::File.open(path).get_entry("word/document.xml")
        document_xml_entry.get_input_stream.read
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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