Sha256: bf18aa0e4e56ff58623ccc5589e3a8d1724d5266863917b92cf3a45bdc369383

Contents?: true

Size: 837 Bytes

Versions: 32

Compression:

Stored size: 837 Bytes

Contents

require 'test_helper'
require 'ndr_import/helpers/file/word'

# Word file helper tests
class WordTest < ActiveSupport::TestCase
  # This is a test importer class to test the Word file helper mixin
  class TestImporter
    include NdrImport::Helpers::File::Word
  end

  def setup
    @permanent_test_files = SafePath.new('permanent_test_files')
    @importer = TestImporter.new
  end

  test 'read_word_file helper should read word file' do
    file_content = @importer.send(:read_word_file, @permanent_test_files.join('hello_world.doc'))
    assert_equal file_content, ['Hello world, this is a word document']
  end

  test 'read_word_file helper should raise exception on invalid word file' do
    assert_raises RuntimeError do
      @importer.send(:read_word_file, @permanent_test_files.join('not_a_word_file.doc'))
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
ndr_import-8.5.0 test/helpers/file/word_test.rb
ndr_import-8.4.0 test/helpers/file/word_test.rb
ndr_import-8.3.0 test/helpers/file/word_test.rb
ndr_import-8.2.0 test/helpers/file/word_test.rb
ndr_import-8.1.0 test/helpers/file/word_test.rb
ndr_import-8.0.0 test/helpers/file/word_test.rb
ndr_import-7.0.0 test/helpers/file/word_test.rb
ndr_import-6.4.1 test/helpers/file/word_test.rb
ndr_import-6.4.0 test/helpers/file/word_test.rb
ndr_import-6.3.0 test/helpers/file/word_test.rb
ndr_import-6.2.0 test/helpers/file/word_test.rb
ndr_import-6.1.1 test/helpers/file/word_test.rb
ndr_import-6.1.0 test/helpers/file/word_test.rb
ndr_import-6.0.0 test/helpers/file/word_test.rb
ndr_import-5.1.0 test/helpers/file/word_test.rb
ndr_import-5.0.0 test/helpers/file/word_test.rb
ndr_import-4.1.4 test/helpers/file/word_test.rb
ndr_import-4.1.3 test/helpers/file/word_test.rb
ndr_import-4.1.2 test/helpers/file/word_test.rb
ndr_import-4.1.1 test/helpers/file/word_test.rb