nebulab / simple_command

A simple, standardized way to build and use Service Objects (aka Commands) in Ruby

Home Page:http://nebulab.it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How mock with rspec with prepended SimpleCommand

Xeej opened this issue · comments

commented
before do
  allow_any_instance_of(Class).to receive(:call).and_return(double)
end

Failure/Error: allow_any_instance_of(Class).to receive(:call).and_return(double)
Using any_instance to stub a method (call) that has been defined on a prepended module (SimpleCommand) is not supported.

commented

Use this

before do
  allow(Class).to receive(:call).and_return(double)
end