stubbing
How to use the real parameters when creating a stub method in RhinoMocks?
I want to create a stub of the following interface: interface IUnitOfWork { void DoInTransaction(Action method);[详细]
2023-02-17 09:36 分类:问答Stub controller action in Rspec controller test, but it's still executed
I would like to test if a controller action is actually called without a redirect happening in some before_filter. Since the controller action itself may do a redirect, I want to stub the action to ra[详细]
2023-02-14 20:31 分类:问答getting the object passed as an argument to a stubbed method with Mocha
Foo.expects(:bar) Foo.bar(:abc => 123, :xyz => 987) # assert Foo.bar was cal开发者_StackOverflowled with a hash that has a key of :abc == 123[详细]
2023-02-13 01:56 分类:问答How would I go about unit testing this?
I need to develop a fairly simple algorithm, but am kindof confused as how to best write a test for it.[详细]
2023-01-29 05:19 分类:问答stub_chain together with should_receive
I am trying to test if in a method calling chain one of the methods get a specif开发者_JAVA技巧ic parameter. In the below code for example MyModel must receive the parameter 0 for the method offset. U[详细]
2023-01-27 04:19 分类:问答Mocking/Stubbing an Application Controller method with Mocha (Using Shoulda, Rails 3)
While writing functional tests for a controller, I came across a scenario where I have a before_filter requesting some information from the database that one of my tests requires. I\'m using Factory_g[详细]
2023-01-19 03:49 分类:问答VS2005 Options Generate Method Stub not working
Ok I installed the linq preview(May 2006) and it seems to have screwed me up. Now the one the of the most important features in VS2005 is not working anymore (Options Generate Method Stub (Shift+Alt+F[详细]
2023-01-10 18:30 分类:问答Where/what to test? Mocks, stubs, functional, unit... (in Ruby/Rails)?
I\'m trying to test a fairly larg开发者_JAVA百科e Rails app, which I probably should have been doing all along but never felt entirely comfortable with.Now I\'m working on a functional test to see if[详细]
2023-01-09 06:21 分类:问答Expectation for find not working, but expectation for find_by_id is
I have this controller code: # GET /cardsets/1 def show @cardset = current_user.cardsets.find_by_id(params[:id])[详细]
2023-01-05 21:16 分类:问答RSpec on Controller and Stubbing
I am pretty new to using rspec and am trying to write my tests for my controllers. I have this controller (I am using mocha for stubbing):[详细]
2023-01-05 18:33 分类:问答