Stubbing out live calls to via Facebooker
I just can’t find a way to stub out Facebooker::Service, this just didn’t seem to work.
fs = mock_model(Facebooker::Service, :post => "1")
Facebooker::Service.stub!(:new).and_return(fs)
So finally I used.
describe FacebookPublisher do
class Facebooker::Service
def post(*args)
return "1"
end
end
it "just should ok" do
Facebooker::Session.create.<some method thingy>
end
end