You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prevents the usage of verified doubles with rspec:
instance_double(ChargeBee::PortalSession,object: 'portal_session')# => error: the ChargeBee::PortalSession class does not implement the instance method: object
i hacked around this in my code with:
ChargeBee::Model.class_eval{attr_reader:object}
but i don't know if this is correct and whether all models include the "object" information.
ideally, each model that has the "object" information would have an attr_reader/accessor for it (or it could be added to Model if its all of them).
instances respond correctly now, but unfortunately, that neither helps with type checks nor with rspec-mocks.
rspec-mocks' #instance_double method takes a class or module as argument, not an instance, so it can only verify the stubbed methods based on currently defined methods, not based on respond_to_missing? return values that would depend on an instance.
Activity
cb-alish commentedon Jun 3, 2025
Hi @jaynetics, this was fixed in
v2.55.0. Could you please give it a try and let us know if you're still facing the issue?jaynetics commentedon Jun 3, 2025
hi!
instances respond correctly now, but unfortunately, that neither helps with type checks nor with
rspec-mocks.rspec-mocks'#instance_doublemethod takes a class or module as argument, not an instance, so it can only verify the stubbed methods based on currently defined methods, not based onrespond_to_missing?return values that would depend on an instance.gastonrey commentedon Dec 23, 2025
Hi, I'm also getting this error related to
respond_to_missing?after upgrading the lib, any workaround?