As it turns out, when using Fog.Mock!
, Fog creates a convenience layer, and you’re not actually dealing with Fog::Compute
, but instead, we end up with Fog::Compute::AWS::Mock
. As such, to stub the method, we need to do it like so:
Fog::Compute::AWS::Mock.any_instance.stub(:addresses).and_return(@fog_conn.addresses)
Stubbing on this object results in things working as expected.