Redirect limit and tests

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Redirect limit and tests

Peter M Souter
Hello! 

I've been trying to give the URL to a Vagrant box I'm storing on dropbox in my vagrant file to download, but for some reason it ends up in a redirect loop and hangs forever. So I looked at the code and thought hey, let's implement the redirect limit! :)

Here's my basic implementation so far:

https://github.com/petems/vagrant/blob/redirect_limit/lib/vagrant/downloaders/http.rb#L17

So, I'm writing the tests for this, what do you think would be better: WebMock, fakeweb or stub the actual HTTP method itself? I'm not sure what the code convention would be for adding new gems for just tests in a project like this

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Redirect limit and tests

Mitchell Hashimoto
Peter,

I've been quite happy with webmock!

Best,
Mitchell


On Thu, Feb 28, 2013 at 2:53 AM, Peter M Souter <[hidden email]> wrote:
Hello! 

I've been trying to give the URL to a Vagrant box I'm storing on dropbox in my vagrant file to download, but for some reason it ends up in a redirect loop and hangs forever. So I looked at the code and thought hey, let's implement the redirect limit! :)

Here's my basic implementation so far:


So, I'm writing the tests for this, what do you think would be better: WebMock, fakeweb or stub the actual HTTP method itself? I'm not sure what the code convention would be for adding new gems for just tests in a project like this

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.