specs busted because IANA now redirects example.com #78

Closed
phiggins opened this Issue Mar 3, 2011 · 4 comments

Comments

Projects
None yet
4 participants
@phiggins
Contributor

phiggins commented Mar 3, 2011

Doing a get on "www.example.com" used to return a simple page, now it redirects to "http://www.iana.org/domains/example/".

This is causing many, many failures when running the specs.

@grig

This comment has been minimized.

Show comment
Hide comment
@grig

grig Mar 11, 2011

Contributor

See #79 for a solution.

Contributor

grig commented Mar 11, 2011

See #79 for a solution.

@phiggins

This comment has been minimized.

Show comment
Hide comment
@phiggins

phiggins Mar 14, 2011

Contributor

I looked over this, and I don't think this is the best way to fix the specs because you're changing what's being tested. IMO, it would be better to replace "www.example.com" with another static page (maybe even "http://www.iana.org/domains/example/") and change the associated content lengths, etc.

Contributor

phiggins commented Mar 14, 2011

I looked over this, and I don't think this is the best way to fix the specs because you're changing what's being tested. IMO, it would be better to replace "www.example.com" with another static page (maybe even "http://www.iana.org/domains/example/") and change the associated content lengths, etc.

@grig

This comment has been minimized.

Show comment
Hide comment
@grig

grig Mar 14, 2011

Contributor

I agree in that this is not the best way; it just appeared to me to be the fastest way to bring specs back to a working state. Using iana.org/domains/example doesn't sound like a good idea to me because its contents are more likely to change than example.com's.

Perhaps there is a better way of testing webmock without relying on behavior of external HTTP servers at all?

Contributor

grig commented Mar 14, 2011

I agree in that this is not the best way; it just appeared to me to be the fastest way to bring specs back to a working state. Using iana.org/domains/example doesn't sound like a good idea to me because its contents are more likely to change than example.com's.

Perhaps there is a better way of testing webmock without relying on behavior of external HTTP servers at all?

@myronmarston

This comment has been minimized.

Show comment
Hide comment
@myronmarston

myronmarston Mar 25, 2011

Collaborator

I merged in @grig's pull request, but ultimately, I agree it's not the best way. It was just the expedient way to get the specs passing again so I could make some other bug fixes.

If either of you want to take a shot at providing a better solution, please do. Here are a couple ideas of mine:

  • Create a simple gist here on github with some known content, and make requests against that.
  • Boot a simple little local sinatra app that returns known responses. This is what I use for VCR (see here and here for the code).
Collaborator

myronmarston commented Mar 25, 2011

I merged in @grig's pull request, but ultimately, I agree it's not the best way. It was just the expedient way to get the specs passing again so I could make some other bug fixes.

If either of you want to take a shot at providing a better solution, please do. Here are a couple ideas of mine:

  • Create a simple gist here on github with some known content, and make requests against that.
  • Boot a simple little local sinatra app that returns known responses. This is what I use for VCR (see here and here for the code).

@jcf jcf closed this Jun 5, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment