From: Ruby Pasaulyje Date: 2010-12-02T03:21:47+09:00 Subject: mocking in rspec 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? 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/.