On Dec 26, 2007 3:23 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> On Dec 23, 2007 2:27 PM, Zach Dennis <[EMAIL PROTECTED]> wrote:
> > I know the questioned are directed towards Dan so I hope you don't me
> > chiming in. My comments are inline.
>
> Thanks a lot for your comments, I really appreciate them.  I've been
> dying to respond to this for the past several days, but haven't had
> internet access.
>
>
> > On Dec 15, 2007 2:17 AM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> > >
> > > On Dec 8, 2007 4:06 AM, Dan North <[EMAIL PROTECTED]> wrote:
> > > > I prefer the mantra "mock roles, not objects", in other words, mock 
> > > > things
> > > > that have behaviour (services, components, resources, whatever your
> > > > preferred term is) rather than stubbing out domain objects themselves. 
> > > > If
> > > > you have to mock domain objects it's usually a smell that your domain
> > > > implementation is too tightly coupled to some infrastructure.
> > >
> > > Assuming you could easily write Rails specs using the real domain
> > > objects, but not hit the database, would you "never" mock domain
> > > objects (where "never" means you deviate only in extraordinary
> > > circumstances)?  I'm mostly curious in the interaction between
> > > controller and model...if you use real models, then changes to the
> > > model code could very well lead to failing controller specs, even
> > > though the controller's logic is still correct.
> >
> > In Java you don't mock domain objects because you want to program
> > toward an interface rather then a single concrete implementation.
> > Conceptually this still applies in Ruby, but because of differences
> > between the languages it isn't a 1 to 1 mapping in practice.
>
> I must be misunderstanding you here, because you say you "don't mock
> domain objects," and the rest of your email suggests that you mock
> basically everything.
>

I'll respond more later, but wanted to point out that that should be
"In Java you mock domain objects because you want to ...". I don't
know how the "n't" got in there. ;)

Zach Dennis
http://www.continuousthinking.com
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to