Hi folks. I'm very interested in the status of a port of any_instance from Mocha to RSpec.
In particular I have a spec suite that I wrote using RSpec but with Mocha that depends heavily on any_instance. This is because it stubs out one or two methods from an underlying API. In attempting to convert the suite to RSpec mocks (because that's what we're using for the rest of the project) I had to give up. Attempting to replace objects by stubbing :new and returning mocks felt like a huge amount of busy work compared to one-line with any_instance. I noticed that Brian Takita appears to have an implementation of any_instance here: http://github.com/btakita/pain-point/tree/ca9a65e7110ccaa37175c741e1cea1aaa9776180/vendor/plugins/rspec/lib/spec/mocks which I tried, without success, to make work in my own version of rspec (1.1.4). I was able to call any_instance but it didn't seem to be having an effect. I emailed Brian but I think he was at rails conf so I guess he may be fighting a backlog of work/email. Is there any likelyhood of any_instance making it into RSpec proper? If not, has anyone else had any luck implementing it? Regards, Matt. -- Matt Mower :: http://matt.blogs.it/ _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
