adiwg / mdTranslator

Metadata translation tool built using Ruby
https://www.adiwg.org/mdTranslator/
The Unlicense
14 stars 12 forks source link

Evaluate Unit Test for Version #348

Open jwaspin opened 4 months ago

jwaspin commented 4 months ago

test/translator/tc_mdJson_reader.rb

There is a test for the version in the above file. For some reason, when mdJson-schemas was updated to 2.9.0 this test started failing. At first glance this test does not make much sense; it should be reviewed for its purpose/benefit and determined if the test is actually necessary. If it is, it needs to be fixed so that the minor version being a '9' is not a problem, otherwise the code should be removed.

It looks like the issue might be related to the minor version become 2 digits when it's incremented to '10'.

Starting on line 160

#  This test needs to be verified that it's still valid and useful.
#     Leave this test disabled until issue #348 is resolved.
#    def test_mdJson_reader_schema_version_future_minor

#       # read in an mdJson 2.x test file with schema object
#       file = File.join(File.dirname(__FILE__), 'testData', 'mdJson_minimal.json')
#       file = File.open(file, 'r')
#       jsonMinimal = file.read
#       file.close

#       # bump minor version
#       version = Gem::Specification.find_by_name('adiwg-mdjson_schemas').version.to_s
#       aVersion = version.split('.')
#       newMinor = aVersion[1].to_i + 1
#       testVersion = aVersion[0] + '.' + newMinor.to_s + '.' + aVersion[2]

#       hJson = JSON.parse(jsonMinimal)
#       hSchema = hJson['schema']
#       hSchema['version'] = testVersion
#       jsonIn = hJson.to_json

#       metadata = ADIWG::Mdtranslator.translate(file: jsonIn)

#       refute_empty metadata
#       assert_equal 'mdJson', metadata[:readerRequested]
#       refute metadata[:readerStructurePass]
#       refute_empty metadata[:readerStructureMessages]

#    end