ncbo / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
15 stars 6 forks source link

Deprecation warnings when running unit test: Comparable#== will no more rescue exceptions of #<=> in the next release #93

Closed jvendetti closed 4 months ago

jvendetti commented 8 years ago

Upgrading to Ruby 2.2.5 results in warnings that originate from goo when executing a particular unit test in the ontologies_linked_data project, i.e.:

bundle exec ruby test/models/test_project.rb -n test_project_created

... gives the following warnings regarding line 247 in settings.rb:

/Users/jvendetti/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/bundler/gems/goo-d2033f801830/lib/goo/base/settings/settings.rb:247: warning: Comparable#== will no more rescue exceptions of #<=> in the next release.
/Users/jvendetti/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/bundler/gems/goo-d2033f801830/lib/goo/base/settings/settings.rb:247: warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison.

Attempting to execute the same unit test with the latest version of Ruby (2.3.1) results in failure:

  1) Error:
TestProject#test_project_created:
ArgumentError: invalid date
    /Users/jvendetti/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.13/lib/active_support/core_ext/string/conversions.rb:53:in `parse'
    /Users/jvendetti/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.13/lib/active_support/core_ext/string/conversions.rb:53:in `to_datetime'
    /Users/jvendetti/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.13/lib/active_support/core_ext/date_time/calculations.rb:164:in `<=>'
    /Users/jvendetti/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/goo-d2033f801830/lib/goo/base/settings/settings.rb:247:in `=='
    /Users/jvendetti/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/goo-d2033f801830/lib/goo/base/settings/settings.rb:247:in `!='
    /Users/jvendetti/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/goo-d2033f801830/lib/goo/base/settings/settings.rb:247:in `block in shape_attribute'
    /Users/jvendetti/Development/GitHub/ncbo/ontologies_linked_data/test/test_case.rb:180:in `model_created_test'
    test/models/test_project.rb:64:in `test_project_created'