Top "Stubbing" questions

Stubbing is modifying an instance method or property of an object at runtime to extend its functionality.

RSpec Stubbing: Return the parameter

Though my question is pretty straightforward, I failed to find an answer around here: How can I stub a method …

ruby parameters rspec return-value stubbing
Populating instance variables in rspec tests

I have a class which has the following initialise method. def initialize(my_var) @my_var = my_var end and …

ruby rspec stubbing
capture parameters passes to stub in powermockito

How can I capture (for assertion purposes) the parmeters passed to a static stub method call? The methodBeingStubbed looks like …

java junit mockito powermock stubbing
Mockito re-stub method already stubbed with thenthrow

I ran into a problem with mockito. I am developing a web application. In my tests the user management is …

java mocking mockito stubbing
Stubbing with Faraday and Rspec

I have a model that looks like this: class Gist def self.create(options) post_response = Faraday.post do |request| …

rspec mocking stubbing faraday
Rhino Mocks stubs and mocks are only good for interfaces?

Is it correct that Rhino Mocks stubs and mocks are only good for interfaces, not concrete classes? I spent quite …

.net unit-testing mocking rhino-mocks stubbing
What is ongoingstubbing in mockito and where we use it?

Can any one explain what is ongoing Stubbing in mockito and how it helps writing in Junit Testcase and mocking …

junit mockito stubbing
Correct way to add helper functions for an rspec spec

So I need a helper function to created 'unprocessed tweets' similar to how I might receive them from the Twitter …

ruby-on-rails rspec stubbing
How to test a function which takes a block with rspec

I have a function, which accepts a block, opens a file, yields and returns: def start &block .....do some …

ruby rspec mocking rspec2 stubbing
Mock a method call from another class

My code structure : class A { void methodA() { //some code B b = new B(); response = b.methodB(arg1, arg2); //some code …

java unit-testing mockito stubbing