Displaying 20 results from an estimated 11000 matches similar to: "Any success with stubbing Net::HTTP::get?"
2006 Aug 09
3
HABTM and getting to arrays from either direction
I didn''t find exactly an answer on this one, so I''d like to get a 
clarification from folks who live & breathe HABTM.
class foo
  has_and_belongs_to_many :bars
end
class bar
  has_and_belongs_to_many :foos
end
(and yes, I have a bars_foos table in my db)
def test_habtm
  bar = Bar.new
  foo = Foo.new
  foo.bars<<bar
  assert !foo.bars.empty?
  assert
2006 Aug 10
2
check_box form helper questions/issues
I''m using Rails 1.1.x and it looks like the check_box form helper 
expects me to provide and object and method so it can determine if the 
checkbox should be checked or not.  I''m having a couple of issues with 
this.
note: I''m using UserEngine and adding a HABTM so that:
class User < ActiveRecord::Base
  has_and_belongs_to_many :foos
end
class foo <
2006 Oct 04
3
do we need stubbing?
Hey all -
The trunk currently supports three types of mocking/stubbing:
Mock Objects (created dynamically at runtime)
Partial Mocking of methods on existing classes
Stubbing of methods on existing objects or classes
The main difference between Partial Mocking and Stubbing is that Stubs
don''t verify.
I''m wondering if we really need the stubbing facility at all, given
that we
2006 Jul 13
1
RailsCron usage question
I''m yet another person looking to do some background Rails processing. 
>From post & the wiki, it looks like I should be using RailsCron.  So I''m 
about to start playing.
In parallel, I''d like to get some opinions re: database access.  I have 
a table that I''d like to re-fresh periodically in the background.  Is it 
safe, using RailsCron, to be accessing
2007 Oct 25
1
Mocking/Stubbing help with subdomain as account key
My app uses account_location to set up subdomains as account keys. In  
my controllers, all my model operations are scoped through the  
@current_person object.
The question is: How do I test this with RSpec''s mocking and  
stubbing? Basically, I need to test that @current_person.things is  
getting the find message and returning @thing. I''ve tried stubbing  
and mocking
2007 Mar 27
2
mocking/stubbing newbie questions
I''m new to mocking and stubbing.  Can someone help me out with the  
following?  I don''t exactly know why this spec is failing:
describe "GET /users/1/terms" do
   controller_name :terms
   setup do
     @user = mock_model(User)
     User.stub!(:find).and_return(@user)
   end
   def do_get
     get :index, :user_id => 1
   end
   it "should find all terms
2007 Nov 14
4
Stubbing out required associated models
Hello,
As I''m becoming more and more familiar with mocking/stubbing, I''m going back
to some of my model specs and revaluating how I wrote them.
I have certain models in which validation requires the presence of an
associated model, which itself needs to be valid(validates_presence_of and
validates_associated).
When I wrote the specs, I wrote helpers for the attributes instead
2007 Aug 14
4
Stubbing all methods
Mocha''s mock/stub framework has the ability to stub all methods on a  
mock given.  Does RSpec''s mocking framework have this ability?  And  
if not, is there some reason it shouldn''t be implemeneted?
Regards,
Scott
2008 Dec 29
2
Source for Kernel
OK, perhaps I wasnt clear in my previous posting.
I am looking for either a SRPM for the CentOS 5.2 centos.plus kernel,
or more likely, a diff from the kernel at kernel.org.
I was pointed to the wiki, which MENTIONED a Source RPM, but didnt
point to anywhere to find these for CentOS.  All Ive been able to
find are ISO's .
I really dont need a bunch of tools that will complicate the problem,
2006 Oct 11
0
stubbing/mocking
All,
Inspired by a conversation on the mocha list, I added the ability to
mix stubs w/ mocks on the same methods.
Here''s what it allows:
context "a mock" do
  specify "can stub! and mock the same message" do
    mock = mock("stubbing mock")
    mock.stub!(:msg).and_return(:stub_value)
    mock.should_receive(:msg).with(:arg).and_return(:mock_value)
   
2009 Jan 06
2
Anyone got Diskless BOOT working under CentOS ???
Im trying to get a diskless boot set up under CentOS 5.2, and having no luck
at all.
I am to the point of running system-config-netboot, and whatever information
I put in, I get an error message.
Responding to the 2nd button on the first popup, which asks for NFS info,
I put in the IP address of the current machine (the machine that will hold
the boot images for the diskless machine) and the
2007 Aug 28
3
How do you keep mocks updated without pain?
Hi!
I know you must be answering a lot of basic questions, sorry about that :-)
However I have not get it, how do you keep mocks updated without pain?
I reached to the point where mocking things for view. I spec
model-controller-view using "correct doc" way mocking-stubbing (plus I
should run integration test to be sure that everything really works
together).
Now, when I want to
2007 Sep 04
3
Model Specs: Fixtures vs Mocks + Stubs?
What is the general opinion about fixtures versus mocking and stubbing
in model specs? I heard from agile on IRC that they save the database
testing for integration testing, but I also see that the caboose
sample applicaiton uses fixtures. I also noticed that on the rspec
site, it says "Ironically (for the traditional TDD''er) these are the
only specs that we feel should actually
2006 Oct 04
0
stubbing/partial mocking
All,
Brian Takita has been contributing to a stubs branch to support
stubbing and partial mocking on Modules (and therefore classes). I
tweaked the syntax a bit and merged it into the trunk, so you can
update from the trunk and check out the new stubbing/mocking love. If
you prefer to wait for a release, there should be one coming soon-ish
(I''m aiming for later this week).
As Brian
2006 Jun 28
3
Autodesk DWG Viewer
Application: DWFViewer.exe
Wine 0.9.14 - mandriva 2006.0
This is Autocad's "free" viewer program for dwf files.  I had to install 
IE6 first as a pre-requisite.  I used the Wine recommended method of 
adding that one dll to the windows/system32 directory then ran 
ie6setup.exe to install it.  The DWFViewer installed fine, but then when 
trying to run it this message came up:
This
2007 Apr 20
5
stubbing with and without a string
What is the difference between these two ways of mocking (with and  
without the string):
mock(''Object'')
and
mock(Object)
?
Scott
2007 Feb 05
2
Mock objects for stubbing out Paypal - anyone have any???
Hi,
Just wondering if anyone has already developed a mocking approach to stub
out the Paypal interface so that one can test on an internal PC which
doesn''t provide a means for PayPal to callback to your webserver?  (i.e.
once the app is deployed to the hosting provider it would then work as
PayPal could then hit the application with the specified URL).
Anyone already solved this?  What
2007 Feb 05
1
Mock objects for stubbing out Paypal - anyone have any???
Hi,
Just wondering if anyone has already developed a mocking approach to stub
out the Paypal interface so that one can test on an internal PC which
doesn''t provide a means for PayPal to callback to your webserver?  (i.e.
once the app is deployed to the hosting provider it would then work as
PayPal could then hit the application with the specified URL).
Anyone already solved this?  Would
2007 Mar 27
3
Stubbing out method for all instances
I am using the acts_as_state_machine plugin to control state of an  
object in my app, however when testing this I need to be able to stub  
out the guard conditions so that state will change when I fire off an  
event without depending on other models.
Guard conditions simply return true or false so I have an instance  
method:
def encoded?
   <check state of other objects>
   return true
2006 Jul 27
0
Should I be extending UserEngine for User Preferences?
Fairly high level question here.
I''m using LoginEngine & UserEngine with success.  My application needs 
to track user preferences, which includes some associations with my 
models.
Should I be extending the UserEngine model(s) and adding my own 
attributes?  This means adding a lot to a plugin, including extending 
controllers and views.
Or should I be creating my own