Skip to content

RDF::List#== raises NoMethodError in Ruby 2.3.x #304

@no-reply

Description

@no-reply

Ruby 2.3.0 removed an error hiding feature in Comparable#==. It turns out RDF::List#== was depending on this feature to return false for comparisons to non Array-like objects.

So in Ruby 2.3.0, we have:

RDF::List[1,2,3] == [1,2,3] # => true
RDF::List[1,2,3] == [1,2]    # => false

RDF::List.new == RDF::URI('http://example.com/moomin') 
# NoMethodError: undefined method `to_a' for #<RDF::URI:0x2b18580e4b10 URI:http://example.com/moomin>

RDF::List.new == RDF::Node.new
#NoMethodError: undefined method `to_a' for #<RDF::Node:0x2b18593970dc(_:g47383576146140)>

I'm working up tests and a patch for this. I think we're just going to need a local implementation RDF::List#== that handles comparisons to other RDF::Values.

We should probably make a policy decision about whether to backport to 1.99.x. The 1.x branch never supported Ruby 2.3 officially, so I'm inclined to simply let it be unless someone wants to submit a PR.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions