search for: anyinstancewithid

Displaying 1 result from an estimated 1 matches for "anyinstancewithid".

2007 Mar 04
4
Rails functional testing and Mocha
...I get a failure: #<Mock:0x11e54b6>.bill - expected calls: 1, actual calls: 0 If I try to increase gross margins by billing the customer twice I get a failure too: #<Mock:0x11e5312>.bill - expected calls: 1, actual calls: 2 Implementation wise it looks like this: A intermediary class AnyInstanceWithID. A method is defined on Class that provides you with instances of it def any_instance_with_id the_id @AnyInstances = {} unless defined? @AnyInstances @AnyInstances[the_id] ||= AnyInstanceWithID.new() end AnyInstanceWithID is a sort of proxy thing on which you set expectations....