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-4.1.0 test/helpers/file/word_test.rb
ndr_import-4.0.1 test/helpers/file/word_test.rb
ndr_import-4.0.0 test/helpers/file/word_test.rb
ndr_import-3.1.6 test/helpers/file/word_test.rb
ndr_import-3.1.5 test/helpers/file/word_test.rb
ndr_import-3.1.4 test/helpers/file/word_test.rb
ndr_import-3.1.3 test/helpers/file/word_test.rb
ndr_import-3.1.2 test/helpers/file/word_test.rb
ndr_import-3.1.1 test/helpers/file/word_test.rb
ndr_import-3.1.0 test/helpers/file/word_test.rb
ndr_import-3.0.1 test/helpers/file/word_test.rb
ndr_import-3.0.0 test/helpers/file/word_test.rb