From: Richard Conroy Date: 2010-12-02T03:51:31+09:00 Subject: Re: mocking in rspec --00032557335a07420304965dcb74 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Dec 1, 2010 at 6:21 PM, Ruby Pasaulyje wrote: > I have a problem with mocking. I have class DistanceMatrix and I would > like to indicate which method form_matrix is called in if/else > statement. I need to use mocha and rspec. Any ideas? > > > Is the Mocha cheat sheet much help? http://cheat.errtheblog.com/s/mocha/ > class DistanceMatrix > > def initialize(*args) > if args[0].class == String > form_matrix(get_data_from_yaml(args[0], args[1])) > elsif args[0].class == Array || args[0] == nil > form_matrix(get_data_from_db(args[0])) > end > end > > def form_matrix() > ... > end > > end > > -- > Posted via http://www.ruby-forum.com/. > > -- http://richardconroy.blogspot.com | http://twitter.com/RichardConroy --00032557335a07420304965dcb74--