Top "Rspec-mocks" questions

rspec-mocks is the part of the RSpec testing framework that provides test doubles: stubs, mocks and spies.

RSpec Mock Object Example

I am new to mock objects, and I am trying to learn how to use them in RSpec. Can someone …

ruby unit-testing rspec rspec-mocks
How to stub a class method using rspec/rspec-mocks

I am using rspec-mock for test-driven-development. I am starting implementing a single class and mocking/stubbing the other classes using …

ruby rspec mocking rspec-mocks
Rspec mocks, can 'expect' also stub a method as a side effect?

I'm trying to make sense of the tests in an inherited app, and I need some help. There are lots …

ruby-on-rails ruby rspec rspec-mocks
Rspec - combine expect_any_instance_of and a receive counts

I need to verify that any instance of my class receives a certain method, but I don't care if many …

ruby-on-rails rspec rspec-mocks
rspec-mocks' doubles are designed to only last for one example

I've got a question about how to share rspec-mocks' double between examples. I'm writing a new rails app with rspec-mocks 3.1.3. …

ruby-on-rails ruby unit-testing rspec rspec-mocks