Is it possible for me to use Mock objects in manual testing? They work great for functional testing, but now I need to load the pages and play around with some stuff, but of course I cant load them because there are a number of classes without implementations, which I want to just mock out. Any ideas? ----------------------------------------------------------------- Find the home of your dreams with eircom net property Sign up for email alerts now http://www.eircom.net/propertyalerts
That''s not generally how one would use mocks, although I suppose it''s possible. Why not just go ahead and define the missing classes? You can write the methods to return canned results until you''re ready to create the real implementation. Also - assuming you''re using Rails - you can put concrete mocks in the test/mocks/development directory which will then override the real implementation when running in development mode. Personally, I think that''s dangerous, but the option is there. -- Regards, John Wilger (Sent from my phone - please excuse the top-post.) On Dec 8, 2007, at 4:41 PM, <nobrow at eircom.net> wrote:> Is it possible for me to use Mock objects in manual testing? > > They work great for functional testing, but now I need to load the > pages and play around with some stuff, but of course I cant load > them because there are a number of classes without implementations, > which I want to just mock out. > > Any ideas? > > ----------------------------------------------------------------- > Find the home of your dreams with eircom net property > Sign up for email alerts now http://www.eircom.net/propertyalerts > > > _______________________________________________ > mocha-developer mailing list > mocha-developer at rubyforge.org > http://rubyforge.org/mailman/listinfo/mocha-developer
Mocha is great, but what you are looking for is a stub. Mocks verify interaction, while stubs simply return canned results. I''d suggest simply using a stub in the test/mocks/development folder. Yes, it''s lame that you need to put a development stub in a dir tree that has "test" and "mock", but it is what it is. You can also add your own folder and explicitly require your mock, but using the Rails mechanism should be good enough unless you really can''t deal with the naming inconsistency. To be clear, you can use mocha, but I wouldn''t bother. Cheers, Jay On Dec 8, 2007, at 4:41 PM, <nobrow at eircom.net> <nobrow at eircom.net> wrote:> Is it possible for me to use Mock objects in manual testing? > > They work great for functional testing, but now I need to load the > pages and play around with some stuff, but of course I cant load > them because there are a number of classes without implementations, > which I want to just mock out. > > Any ideas? > > ----------------------------------------------------------------- > Find the home of your dreams with eircom net property > Sign up for email alerts now http://www.eircom.net/propertyalerts > > > _______________________________________________ > mocha-developer mailing list > mocha-developer at rubyforge.org > http://rubyforge.org/mailman/listinfo/mocha-developer