Skip to content

Evaluate Unit Test for Version #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jwaspin opened this issue Feb 20, 2024 · 0 comments
Open

Evaluate Unit Test for Version #348

jwaspin opened this issue Feb 20, 2024 · 0 comments

Comments

@jwaspin
Copy link
Contributor

jwaspin commented Feb 20, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant