If I have a should_receive expectation to a function which is cached then the test fail with the error singleton can't be dumped
singleton can't be dumped
I need to Rails.cache.stub(:write) to make my tests succeed again.
Is there any other way to correct that than this workaround, could we fix this in rspec's code?
Source for my workaround is this tweet
OSX 10.8.3, Ruby 2.0.0
Can you put together some example code demonstrating this?
This sounds plausible to me, I'm not sure I'd expect Rails to be able to cache message expectations.
As @myronmarston says, can you provide the spec's you attempted to write? Then we might be able to help figure out wether this is a bug, or suggest an alternative way to spec this.