Re: [rspec-users] Using Hash to mock classes that respond to :[]

2008-05-19 Thread Ashley Moran
On 19 May 2008, at 17:57, John D. Hume wrote: I do that sort of thing pretty often. I would just point out that you should avoid calling that mocking, since there are no expectations in place and therefore no verification of the specific way the code being specified interacts with the Mi

Re: [rspec-users] Using Hash to mock classes that respond to :[]

2008-05-19 Thread John D. Hume
I do that sort of thing pretty often. I would just point out that you should avoid calling that mocking, since there are no expectations in place and therefore no verification of the specific way the code being specified interacts with the MigrationGraph. According to the definitions in http://mar

[rspec-users] Using Hash to mock classes that respond to :[]

2008-05-18 Thread Ashley Moran
Hi I've been doing this a while now. If I have a class that responds to : [], and all I'm interested in stubbing is that method, then instead of using a mock I just create a hash. (Similarly, you could create an array when you are testing an Enumerable object.) Example from code I just w