Agreed.  I initially tried to do something like that, but as you said, the hard part is being there to initialize the resource with that data source.  If you could patch the base resource class to set some "test" flag when initializing in a testing environment, that should be enough to do the trick.