Sha256: f5cffe8360d5eb10e875f6cb706dee4f177bc640876d03b87764b2df0a02a42f

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

# encoding: UTF-8

require File.join(File.expand_path(File.dirname(__FILE__)), '../test_helper')

class ImportTest < ActiveSupport::TestCase
  TEST_DATA = File.open(File.expand_path("../../fixtures/hobbies.nt", __FILE__))

  setup do
    @importer = SkosImporter.new(TEST_DATA, "http://hobbies.com/")
  end

  test "import inflectionals" do
    assert_difference "Concept::SKOS::Base.count" do
      @importer.run
    end

    concept = Concept::SKOS::Base.first

    assert_equal 2, concept.pref_labels.first.inflectionals.count
    assert_equal 1, concept.pref_labels.first.inflectionals.where(:value => "Computer programming (used as xl:prefLabel)").count
    assert_equal 1, concept.pref_labels.first.inflectionals.where(:value => "Computer programmings").count

    nerding = Label::SKOSXL::Base.where(:origin => "nerding").first

    # test for duplicate inflectionals not getting created
    assert_not_nil nerding
    assert_equal 1, nerding.inflectionals.count
    assert_equal "Nerding", nerding.inflectionals.first.value
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iqvoc_inflectionals-2.11.4 test/unit/import_test.rb
iqvoc_inflectionals-2.11.3 test/unit/import_test.rb
iqvoc_inflectionals-2.9.0 test/unit/import_test.rb
iqvoc_inflectionals-2.8.0 test/unit/import_test.rb