Skip to content

Commit

Permalink
Ensure that complete.cff is validated in the tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Feb 22, 2024
1 parent bfae4a7 commit af2aab7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/validatable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@ def test_short_example_file_validate
refute(result[2])
end

def test_complete_example_file_validate!
cff = ::CFF::File.read(COMPLETE_CFF)

assert_raises(::CFF::ValidationError) do
cff.validate!
end

cff.validate!(fail_on_filename: false)
end

def test_complete_example_file_validate
cff = ::CFF::File.read(COMPLETE_CFF)

result = cff.validate
refute(result[0])
assert_empty(result[1])
refute(result[2])

result = cff.validate(fail_on_filename: false)
assert(result[0])
assert_empty(result[1])
refute(result[2])
end

def test_empty_cff_version_raises_error
cff = ::CFF::File.read(MINIMAL_CFF)
cff.cff_version = ''
Expand Down

0 comments on commit af2aab7

Please sign in to comment.