in reply to Re^8: Testing with Test::Mock::HTTP::Tiny
in thread Testing with Test::Mock::HTTP::Tiny

I've changed the domain to one that doesn't exist on t'interweb so I can be sure the test code is using the mocked data and not going off and fetching a fresh page.

Sooner or later, a troll will register the domain. Better either use a domain that you control, or use one of the domains reserved for purposes like this (see RFC2606):

Reserved Top-Level Domains (Quoting RFC2606):

Reserved Second-Level Domains (again quoting RFC2606):

RFC6761 updates RFC2606 with best practices.

If you fake a domain data, you should probably use the .test or .invalid TLDs. If you have no better idea, use something like bod-example-1.test, bod-example-2.test, and so on. Probably, you may want to name your domains to match your tests, e.g. working-host.invalid, wrong-cert.invalid, and so on.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^10: Testing with Test::Mock::HTTP::Tiny
by Bod (Parson) on Sep 30, 2023 at 00:05 UTC
    Sooner or later, a troll will register the domain

    Ah yes...I'd overlooked that strange TLDs like crawl can now be registered...

    Fortunately I read this (and acted on it) lust before updating the code on GitHub and uploading WWW::Crawl to CPAN