Skip to content

Failing test in Ruby 3.1 #152

@destsimon

Description

@destsimon

The test does not allow a url with only a scheme is failing in Ruby 3.1.4

A scheme only url is passing as valid: http://

Looks like the reason is changed behavior in the URI class:

In Ruby 3.0.6:

[1] pry(main)> uri = URI.parse('http://')
=> #<URI::HTTP http:>
[2] pry(main)> uri.host
=> nil

uri.host returns nil

In Ruby 3.1.4:

[1] pry(main)> uri = URI.parse('http://')
=> #<URI::HTTP http://>
[2] pry(main)> uri.host
=> ""

uri.host returns an empty string

URI is used here

Metadata

Metadata

Assignees

No one assigned

    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