Skip to content

Conversation

@strzibny
Copy link
Contributor

This fixes failed builds on master:

https://travis-ci.org/chrisk/fakeweb/jobs/28254294

Note: it won't show success until #48 is merged.

zeha added a commit to zeha/fakeweb that referenced this pull request Mar 3, 2016
Applies on top of the changes for 2.2 (chrisk#53).
chrisk added a commit that referenced this pull request Jun 21, 2017
The existing test below, #register_uri_without_domain_name, was
mistakenly constructed to call FakeWeb.register_uri with a string for
the third argument rather than an options hash as in all other
invocations. This was masked by the invalid second argument (trying to
use 'test_example2.txt' as a domain name) because FakeWeb checks that
first.

As of Ruby 2.2, URI supports parsing domain names that use the new
generic top-level domains (gTLDs), such as .info, .tech, etc.  Although
.txt is not an active TLD, URI no longer concerns itself with this
problem and now only raises a URI::InvalidURIError when a domain name is
syntactically invalid. So starting with Ruby 2.2, the error in this test
was no longer masked.

It started raising this instead:

    TypeError(<no implicit conversion of Symbol into Integer>)

...because it was trying to treat the String argument as a Hash
internally.

Since that error isn't very intuitive, this adds an explicit check for
passing non-hashy objects where a hash of response options is expected,
raising an ArgumentError instead.

Thanks for reporting: @strzibny in #53, @davidcornu in #58.
chrisk added a commit that referenced this pull request Jun 21, 2017
As of Ruby 2.2, URI supports parsing domain names that use the new
generic top-level domains (gTLDs), such as .info, .tech, etc.  Although
.txt is not an active TLD, URI no longer concerns itself with this
problem and now only raises a URI::InvalidURIError when a domain name is
syntactically invalid. So this test only worked on older Rubies.

Thanks to @davidcornu for reporting and suggesting a new string to use
in #58. Thanks also to @strzibny for reporting in #53.
@chrisk chrisk closed this in cf8a475 Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant