From: Ed Howland Date: 2005-10-28T03:00:13+09:00 Subject: Re: [RCR] Cut-based AOP On 10/27/05, itsme213@hotmail.com wrote: > > Yep, since DI is a very powerful mechanism for Unit Testing. So you are saying that AOP (or cuts here for example,) can be used to create DI where you don't already have it. Hmm. #contrived require 'collaborator' class A def initialize @collab = Collaborator.new end # ... end # in TestCase def setup @mock_collab = MockCollab.new # or some DynamicMock library end cut NutherA < A def initialize @collab = @mock_collab # ignore super for the example end end def test_add_mock_collab a = A.new assert_equals("expected", a.do_something_with_collab) end Is this what you were refering to with DI and Unit testing with AOP? > Except the cut-style allows you to do RealObjects, MockObjects, and > PartialMocks. Can you expand on this a little? What are RealObjects (other than the obvious) and PartialMocks? Aren't RealObjects just real objects that are being mocked? How does the cut-style help? Thanks Ed