Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

Stubbing Out Faraday

Webmock to disable net connections

Rspec Mocks

To stub it out I could either

These Both Work
1
2
3
4
5
6
7
before do
  allow(MyService).to receive(:new) { double }
end

before do
  allow_any_instance_of(MyService).to receive(:publish)
end

Really cool. The allow_any_instance_of() is pretty sweet to reference an unnamed instance of a class. Pretty sweet.

Comments