similar to: FakeWeb test helper for Net::HTTP / open-uri web requests

Displaying 20 results from an estimated 2000 matches similar to: "FakeWeb test helper for Net::HTTP / open-uri web requests"

2013 May 07
2
Net::HTTP
I''m looking at the documentation: http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html And I notice two uses of Net::HTTP. Both are using GET requests. But what''s the difference? When to use which? Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri response = http.request request # Net::HTTPResponse object end uri =
2010 Aug 29
0
Troll - A Rails plugin for making webservice mocking easier
Hi Folks, Troll trumps your existing ActiveResource mocking libraries like inbuilt HttpMock,Fakeweb or Webmock out of water. With Troll, ActiveResource mocking just works, some of its features: 1. Don''t need to mock calls at Net::HTTP level (which webmock,fakeweb do). Really, we don''t care what HTTP library ActiveResource uses, fakeweb and webmock bring additional complexity
2006 May 23
1
Mongrel 0.3.13 Pre-Release Update -- Yep, Again
Hi Folks, This is another pre-release announcement with lots of goodies for people to test and play with. At this rate the 0.3.13 release may just turn into 0.4. GETTING IT Pretty simple, just gem install mongrel --source=http://mongrel.rubyforge.org/releases/ You can get more information at http://mongrel.rubyforge.org/ WHAT''S IN IT This release has lots of little things, mostly
2005 Aug 25
0
multiple refreshs clicks cause errors in WEBrick
Hi all I am new to rails, so I hope it is not a trivial question... I am using rails with webrick and MySql4.1 on win XP. I enter a simple action (with a post method) which fetches some data from a ''users'' table and present it in a rhtml view. Now when I press the refresh button quickly a few times I get in the command line window errors such as this: [2005-08-25 17:08:55]
2006 Sep 13
1
Net::HTTPResponse
Hello :) I have a problem with the Net::HTTP library... The Net::HTTP library [1] uses a Net::HTTPResponse object for all it''s responses from web servers. This class has many subclasses, such as HTTPSuccess, HTTPRedirecttion, etc. When obtaining a response, the library suggests to check what it is by testing the class of the returned object - using case/when or kind_of? (which it does
2006 Mar 28
7
Is Ruby stable for production use?
Hi, I realise that Windows is a poor platform and that Webrick is a development, not production, server. However, we have started seeing this crop up when perfectly simple page to page links are invoked... [2006-03-28 08:32:21] ERROR Errno::ECONNABORTED: Software caused connection abort /usr/lib/ruby/1.8/webrick/httpresponse.rb:324:in `write''
2007 Mar 26
1
Streaming content
Hello I''m attempting to write a mongrel plug-in which would stream a response. At first I was doing this def process(request, response) response.start do |head,out| head[''Content-Type''] = ''text/html'' %w{o m g}.each { |c| out.puts c; sleep 5; } end response.done = true end But then I looked at HttpResponse and decided
2012 Mar 22
0
problems configuring cluster to lucci and virtual machines resource
I have Centos 6.1 and i'm configuring cluster with conga, lucci and ricci these services are installed and running without problem. I need this type configuration for a high availability of virtual machines which is run on kvm. My problem is at the time of configuring "service group", when i click to add appears the new windows wich say "add service to cluster" and i fill
2006 Aug 02
1
Modifying Mongrel Examples
Hi, I am tryinig to work on the Mongrel examples. I am trying to modify the HttpResponse. def process(request, response) response.start do |head,out| if request.params["REQUEST_METHOD"] == OPTIONS" else end end One can detect that the request is OPTIONS like this, but how does one generate the custom response by using HttpResponse. Please help. Shubham
2007 Jan 01
0
Net::HTTP.get_response with local files "file://..."
Hi, In my application I fetch a webpage with Net::HTTP.get_response(url). For creating a unit test I don''t want to be depended on an internet connection. So I tried to give an url like that: "file:///c:/mydir/mypage.html" (this url works in webbrower). But it seems that this is not the right protocol for Net::HTTP. Is there any possibility to use such
2006 Jul 21
1
What''s wrong with this code?
I''m trying to interface with the flickr API to pull my photos into my site. I don''t want to use the "flickr.rb" gem, I''d like to do it the other way so I can learn (plus I had trouble loading the gem on my server). Anyway, here''s what I have: #Application.rb controller def get_response(path, http) request = Net::HTTP::Get.new(path)
2011 Aug 15
3
- WEBrick server refuses to launch
Running Ruby 1.8.7, Rails 3.0.7 on a Windows 7 machine - tried going through an upgrade to Ruby 1.9.2 over the weekend, but ran into issues, so have since gone back to 1.8.7. After restoring my app and re-installing all of the gems, the application finally launches with rails s: => Booting WEBrick => Rails 3.0.7 application starting in development on http://0.0.0.0:3000 => Call with -d
2010 Jul 01
1
Interesting "Bad Certificate" Problem
All, I''m having an interesting certificate problem with a host I provisioned today. The host was provisioned and puppet was installed as part of the post-os provisioning process. After I signed the certificate I see the following on the client side: [root@client ~]# puppetd --verbose --no-daemonize notice: Starting Puppet client version 0.25.4 err: Could not retrieve catalog from
2009 Jan 29
0
Net:HTTP.post returns an Array
I was wondering if anyone has run into this problem. I post using a Net::HTTP object and instead of getting Net::HTTPResponse object, the server returns an Array causing an error since an we typically attempt to read the body of the Net::HTTPResponse object. Does anyone know why this is occurring? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you
2006 Jan 22
3
Download an Image using Net::HTTP
Hi, I need to download an image, and I''ve mucked about with Net::HTTP resp = Net::HTTP.get_response(''www.mydomain.com'', ''/test.jpg'') f = File.new("test.jpg","w") f.write(response.body) And various other combinations using HTTP.get etc. Anyway, I get an image, but it looks very psychedelic. This is obviously not the correct way.
2008 Apr 11
2
issues on Net:HTTP
in cotroller: @url=URI.parse(''http://google.com.sg/webhp'') @res = Net::HTTP.get_response(@clarifyurl) in view: <%=@res.body> this page displayed as 301 Moved The document has moved here what''s wrong with my code, I want to get the correct reponse HTML content from google. --~--~---------~--~----~------------~-------~--~----~ You received this message
2006 Feb 06
1
Check, and display, AIM status on rails page
Thought I''d post this in case it''s of use to anyone. Maybe even a recipe? It''s just some simple helpers to show AIM status on a webpage. I searched before coding it, and didn''t find anything similar. Maybe that''s because it was so simple :) These methods belong in a helper (such as app/helpers/application_helper.rb) # begin AIM helper methods def
2012 Jan 15
1
How to mock out a WEBrick::HTTPServer?
partial code : http://pastie.org/3186140 I want to test a HTTP server, I''m using lower level stuff so I can understand whats going on, then I might move onto FakeWeb/WebMock/etc Its a reverse proxy, so it doesn''t generate the page content. I want to test a/ methods in the class in isolation b/ test that if a HTTP request sent in generates a HTTP request out (suppose should be
2012 Jul 05
0
tests , assertion output value always <>
no problem running my tests ( units , functionals ) but when assertion failed , I never see any assertion output value, it''s always <> and expected also is <> i.e. : => 33: assert ability.can? :index, User 34: get :index 35: assert_response :success 36: assert_not_nil assigns(:users) <> expected but was <> I must have some
2010 Oct 31
1
Rails application Webservices
hi all, I have a rails application at http://electric-sky-98.heroku.com/products require ''net/http'' require ''uri'' res = Net::HTTP.get_response(URI.parse(''http://electric- sky-98.heroku.com/products.xml'')) puts res.body the above code gave me the xml file below: <?xml version="1.0"