Displaying 20 results from an estimated 1000 matches similar to: "How to mock out a WEBrick::HTTPServer?"
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
0
FakeWeb test helper for Net::HTTP / open-uri web requests
Hey All,
I''ve posted the first release of FakeWeb, a little library to help
with all your http client testing needs. This helper makes it trivial
to setup an idempodent environment for you to test any web service
requests in your applications.
Available on RubyForge, http://rubyforge.org/projects/fakeweb/
== Overview
* Force Net::HTTP (and any dependent libraries, e.g. open-uri) to
2007 Jul 31
0
Patch: Allow overriding of handler dispatch in Mongrel::HttpServer
Hi Zed (and list),
I first of all wanted to thank you for all the hard work you''ve done
to make writing
HTTP services in Ruby easier and more reliable. A friend of mine and
I are developing
a network filestore service (similar to S3) based on Mongrel, and we
got a fairly
useful set of functionality done and working in a matter of a few
weeks thanks
largely to your work. Mongrel
2007 Aug 06
4
[Patch] HttpServer.port reports the bound port
This is for when you pass mongrel 0 for the port and the OS assigns
an open one.
Corey
--- mongrel-1.0.1/lib/mongrel.rb 2007-08-05 15:29:59.000000000
-0700
+++ mongrel-1.0.1/lib/mongrel.rb.zero_port_fix 2007-08-05
15:29:23.000000000 -0700
@@ -560,7 +560,7 @@
@socket = TCPServer.new(host, port)
@classifier = URIClassifier.new
@host = host
- @port = port
2008 Nov 01
5
Issues after removal of rpsec plugins and gem install
autotest will no longer run my tests after I installed the rpsec gem and
removed the plugins. I did install the rspec-rails gem as well.
Is anyone else having this issue?
--
Posted via http://www.ruby-forum.com/.
2011 Feb 16
3
stubbing gets undone?
I''m looking at an example where a stub seems to work sometimes, and
sometimes appears to become "unstubbed". I haven''t boiled it down to a
minimal example, but it goes something like this:
---- the model:
class Premise << ActiveRecord::Base
def lookup_stuff_on_the_web
$stderr.puts("entering lookup_stuff_on_the_web with #{self}")
...
end
end
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them
do not. Does anyone know if there is a way to disable the HttpMocks
after they have already been loaded? The method
ActiveResource::HttpMock.reset! only removes all the objects, but
ActiveResource still thinks it should look for mock requests rather
than actually making requests. I hope this makes sense!
Thanks,
Tom
--
2009 May 04
6
cucumber - when to stub/mock
I''m just curious about this, since my solution involved stubbing a
call to GeoIp.
Is there a good rule of thumb for when you make exceptions to the ''no
stubbing'' philosophy of Cucumber?
My step was: "Given I am accessing the site from Japan," but I can
think of other situations - mostly when interacting with web services,
that I''d probably
2007 Dec 04
3
svn: Connection closed unexpectedly when getting trunk
Is anyone else getting this message?
With rails 2.0 pre-releases it looks like you also have to be working
with the latest version of rpsec.
$ ruby script/plugin install
svn://rubyforge.org/var/svn/rspec/trunk/rspec
svn: Connection closed unexpectedly
The above is what I get when I try to install the trunk version.
Is there something that I am missing?
Thanks
--
Posted via
2007 Oct 18
4
Feeding the framework ?
Hi there,
Is it just me or do many other rspec / rpsec_on_rails users spend more
time than they would like feeding the framework ?
Don''t get me wrong, I love rpsec, but I seem to spend about 2/3 hours
per week hunting down rspec problems.
For example, today `rake spec:models` is broken. When I migrate, load
fixtures and run `spec -cfs` all is well. When I run `rake spec:models`,
2013 Jun 09
2
Minitest mock or stub methods
Hi
I''m building a small library to use in my Rails app which interacts with a
3rd party API. It fetches artists and tracks.
So I have:
lib/my_lib.rb
lib/my_lib/artist.rb
lib/my_lib/track.rb
To get an artist I do
artist = MyLib::Artist.find("Oasis")
Which returns an instance of Artist if it finds (via 3rd party API) it or
nil otherwise.
Then I can call artist.tracks which
2006 Dec 01
1
Specifying lib classes in a Rails app
The rpsec-on-rails app defines a great structure for specifying all of
the constituent parts of a rails app. Does anybody have any advice for
where to put tests for lib code that you include to support your app,
and how to fit it in to the rake:spec rake task.
Cheers
Steve
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
2006 Mar 18
2
problem with webrick and edge rails
i know i do not really have the right to seek help with edge rails,
but i am hoping it is something trivial.
quick scenario:
$ rails test # create a new project
$ svn import # import it into the repo, then go elsewhere, and checkout
$ ruby script/server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
2008 Jul 21
2
webrick needs 80 seconds for starting
ruby script/console webrick
after 23 seconds:
=> Booting WEBrick...
after 78 seconds:
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2008-07-21 08:07:17] INFO WEBrick 1.3.1
[2008-07-21 08:07:17] INFO ruby 1.8.6 (2007-09-24) [i386-mswin32]
[2008-07-21 08:07:17] INFO WEBrick::HTTPServer#start: pid=4664
port=3000
2007 Feb 28
2
Fixture name not available as class variable in spec
Hi there,
I can''t seem to access the fixture name as a class variable from my
specs. I have to set the variable in the spec setup.
... [fixtures]
my_fixture:
id: 1
... [rpsec]
@my_fixture.id.should == 1
... [error]
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.id
... [my setup]
RSpec-0.7.5.1 (r1395) - BDD for Ruby
Rails
2007 Dec 14
5
How do I mock params?
Here is the code within the controller:
Line 69: @photo = @member.build_photo(params[:photo]) unless
params[:photo][:uploaded_data].blank?
I got a little ahead of myself and wrote the code, and now have a bunch
of errors telling me that:
-------
6)
NoMethodError in ''Spec::Rails::Example::ControllerExampleGroup
MembersController handling PUT /members/1 should find the member
2007 Feb 11
1
Specing Rails Views
Hello -
I''m currently trying to write some specs for my rails views. My
views depend upon
the restful authentication plugin method logged_in? Like so,
<% if logged_in? %>
<ul id="product-admin-nav">
<dd><%= link_to "create a new product", new_product_url %></dd>
</ul>
<% end %>
However, when I have the following
2006 Mar 07
2
webrick RoutingError
problem: webrick will start a rails server, but I cannot access my
application. I get the error:
Processing Base#index (for 127.0.0.1 at Tue Mar 07 19:16:58 CET 2006)
Parameters: {}
ActionController::RoutingError (Recognition failed for
"/keywordeditor"):
my application is called keywordeditor. I am starting the server from
the correct place with the correct command (I already
2006 Mar 10
0
WEBrick crashing
ruby 1.8.2 (2004-12-25) [i386-mswin32]
latest version of edge rails - patched to make the server work with
win32 (http://dev.rubyonrails.org/ticket/4139)
On some pages WEBrick is crashing with the following:
d:/programming/ruby/lib/ruby/1.8/profiler.rb:27: You have a nil object
when you
didn''t expect it! (NoMethodError)
You might have expected an instance of Array.
The error occured