Displaying 1 result from an estimated 1 matches for "expectationerror".
2007 Sep 05
4
Mocking to spec a sort_by method
...ionality,
add_vehical is the method to add objects to the stack.
My sort_by method in the comparer class looks like
def sort_by(symb)
@vehicals.sort_by{|vehical| vehical[symb] }
end
where @vehicals is an instance variable array (the stack).
Running my spec gives the following error,
Mocha::ExpectationError in ''Comparer should be sortable on a specific symbol''
#<Mock:0x251b7c8>.[](:mph) - expected calls: 0, actual calls: 1
I assume sort_by is trying to call a [] method ? How do I stub this
method correctly using Mocha ?
Thank you for any help,
Chris
--
Chris Lowis...