Top "Stubbing" questions

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

Sinon.JS stub for window.location.search

I am trying to test a simple function that makes a call to window.location.search. I'm trying to understand …

coffeescript stubbing sinon buster.js
Mock a method with an object parameter with Mockito

In my unit test i want to mock the interaction with elasticsearch by doing the following when(cityDefinitionRepository.findCitiesNearby(geoPoint, …

java unit-testing mockito matcher stubbing
stub_chain together with should_receive

I am trying to test if in a method calling chain one of the methods get a specific parameter. In …

ruby-on-rails rspec rspec2 stubbing
What is the difference between rhino-mocks stub and expect

What is the difference between rhino-mocks stub and expect here: Looks to me that they behave exact the same? mockContext.…

mocking rhino-mocks stub stubbing expectations
Mockito doesn't correctly stub methods taking list as argument

I am trying to mock a class and return a stubbed list of objects when a method on the mocked …

java unit-testing mockito stubbing argument-matcher
PowerMockito. Mock static method. why does not PowerMockito#stub work?

I want to mock only one static method in class, all other methods should work like real object. code: public …

java unit-testing mockito powermock stubbing
Given wsdl + xds type file, how do I create a stub WCF webservice?

I understand this is a basic topic but never done this before starting from wsdl. I am being handed a …

wcf web-services wsdl stubbing
Stubbing with Wiremock - WithBodyFile Location other than _files

Wiremock Documentation states that the location of the file specified in withBodyFile should be in src/test/resources/__files. I …

java stubbing wiremock
Stubbing when an object's constructor builds another object

So I've got some code that, grossly simplified, looks like this: class B def initialize opts @opts = opts end end …

ruby constructor rspec stubbing rr
When to use stubs and mocks?

I've this confusion all the time. If I write a code which uses fake code to assert some operation, how …

unit-testing mocking stubbing