Sha256: a5c6046c9954c12339612dca65e3eb49fdbd0e223c8b8b412b6b010762a32a12

Contents?: true

Size: 1.07 KB

Versions: 32

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

# This tests the NdrImport::NonTabular::Mapping mapping class
class MappingTestTest < ActiveSupport::TestCase
  def test_should_raise_error_with_no_non_tabular_row
    assert_raise NdrImport::MappingError do
      NdrImport::NonTabular::Mapping.new(
        'columns' => [{ 'column' => 'one' }]
      )
    end
  end

  def test_should_raise_error_with_no_non_tabular_row_start_line_pattern
    assert_raise NdrImport::MappingError do
      NdrImport::NonTabular::Mapping.new(
        'non_tabular_row' => nil,
        'columns' => [{ 'column' => 'one' }]
      )
    end

    assert_raise NdrImport::MappingError do
      NdrImport::NonTabular::Mapping.new(
        'non_tabular_row' => { 'start_line_pattern' => nil },
        'columns' => [{ 'column' => 'one' }]
      )
    end
  end

  def test_should_initialize_with_non_tabular_row
    mapping = NdrImport::NonTabular::Mapping.new(
      'non_tabular_row' => { 'start_line_pattern' => /\A-*\z/ },
      'columns' => [{ 'column' => 'one' }]
    )
    assert_equal(/\A-*\z/, mapping.start_line_pattern)
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
ndr_import-4.1.0 test/non_tabular/mapping_test.rb
ndr_import-4.0.1 test/non_tabular/mapping_test.rb
ndr_import-4.0.0 test/non_tabular/mapping_test.rb
ndr_import-3.1.6 test/non_tabular/mapping_test.rb
ndr_import-3.1.5 test/non_tabular/mapping_test.rb
ndr_import-3.1.4 test/non_tabular/mapping_test.rb
ndr_import-3.1.3 test/non_tabular/mapping_test.rb
ndr_import-3.1.2 test/non_tabular/mapping_test.rb
ndr_import-3.1.1 test/non_tabular/mapping_test.rb
ndr_import-3.1.0 test/non_tabular/mapping_test.rb
ndr_import-3.0.1 test/non_tabular/mapping_test.rb
ndr_import-3.0.0 test/non_tabular/mapping_test.rb