Sha256: c3091f6400a5a3f89d2c2f25047cf029054f267838bbfe8518705c2284168fa5

Contents?: true

Size: 637 Bytes

Versions: 10

Compression:

Stored size: 637 Bytes

Contents

require 'test_helper'
require 'ndr_import/file/xml'

module NdrImport
  module File
    # Xml file handler tests
    class XmlTest < ActiveSupport::TestCase
      def setup
        @permanent_test_files = SafePath.new('permanent_test_files')
      end

      test 'should return enum of xml elements' do
        file_path = @permanent_test_files.join('sample.xml')
        handler   = NdrImport::File::Xml.new(file_path, nil, 'xml_record_xpath' => 'root/record')
        rows      = handler.send(:rows)
        assert rows.is_a? Enumerator
        assert(rows.all? { |row| row.is_a? Nokogiri::XML::Element })
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ndr_import-8.5.0 test/file/xml_test.rb
ndr_import-8.4.0 test/file/xml_test.rb
ndr_import-8.3.0 test/file/xml_test.rb
ndr_import-8.2.0 test/file/xml_test.rb
ndr_import-8.1.0 test/file/xml_test.rb
ndr_import-8.0.0 test/file/xml_test.rb
ndr_import-7.0.0 test/file/xml_test.rb
ndr_import-6.4.1 test/file/xml_test.rb
ndr_import-6.4.0 test/file/xml_test.rb
ndr_import-6.3.0 test/file/xml_test.rb