karenetheridge / JSON-Schema-Modern

Validate data against a schema using a JSON Schema
https://metacpan.org/release/JSON-Schema-Modern/
Other
10 stars 1 forks source link

cannot validate format "date-time": Can't locate Time/Moment.pm #50

Closed eserte closed 3 years ago

eserte commented 3 years ago

t/formats.t fails on some of my systems --- probably if Time::Moment is not installed:

    #   Failed test 'assertion behaviour can be enabled later with an already-loaded schema'
    #   at t/formats.t line 235.
    # Compared $data->{"errors"}[0]{"error"}
    #    got : 'cannot validate format "date-time": Can't locate Time/Moment.pm in @INC (you may need to install the Time::Moment module) (@INC contains: ... ) at /usr/home/cpansand/.cpan/build/2021081420/JSON-Schema-Modern-0.516-8/blib/lib/JSON/Schema/Modern/Vocabulary/FormatAssertion.pm line 152.
    # '
    # expect : 'not a date-time'

    #   Failed test 'valid assertion behaviour does not die'
    #   at t/formats.t line 251.
    # Comparing hash keys of $data
    # Extra: 'errors'
... (etc) ...
    # '
    # expect : 'not a date-time'

    #   Failed test 'valid assertion behaviour does not die'
    #   at t/formats.t line 274.
    # Comparing hash keys of $data
    # Extra: 'errors'
    # Looks like you failed 4 tests of 5.

#   Failed test 'toggle validate_formats after adding schema'
#   at t/formats.t line 279.
# Looks like you failed 1 test of 6.
t/formats.t ............................. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests 
karenetheridge commented 3 years ago

This is fixed in release 0.517.