[Rspec-devel] New proc.should_increment method

Brian Takita brian.takita at gmail.com
Sat Jul 15 16:51:16 EDT 2006


>
> I was talking to Steve about this today. He's working on an a
> memory_connection_adapter that you could use instead of a DB as long
> as you don't write any in-line sql.


Even in the case of in-line sql a mock can handle the custom inline sql,
providing both assertions and return values.
For example we test our deploy scripts by adding a Spy that collects all of
the shell commands. We then assert the correct commands are called. Its not
deterministic, but its a quick way to verify the external API doesn't change
unless you want it to.

It's not just integration w/ the tables - it's complete reliance on
> the tables for the data structure. In my view, they are PART of the
> models and should be included when you're testing the models. I just
>
don't think  you need them when you're testing everything else.


Would it be wise to


On 7/14/06, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> On 7/14/06, Lachie <lachiec at gmail.com> wrote:
> > Thanks :)
> >
> > > -Which is not BDD, but still useful in Rails while waiting for better
> > > mock support in rails.
> >
> > In the rails-and-pure-BDD context, do you guys see mocking replacing
> > AR connecting to a DB in model specs?
>
> I was talking to Steve about this today. He's working on an a
> memory_connection_adapter that you could use instead of a DB as long
> as you don't write any in-line sql.
>
> My thinking is that it's ok to use the DB for AR-backed models and
> high level acceptance tests (integration tests), but that's all.
>
> >
> > This is somewhere I'd always want to write state-bases specs, pure BDD
> > notwithstanding, because of AR's thorough integration with my tables.
>
> It's not just integration w/ the tables - it's complete reliance on
> the tables for the data structure. In my view, they are PART of the
> models and should be included when you're testing the models. I just
> don't think  you need them when you're testing everything else.
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060715/c2679ce1/attachment.html 


More information about the Rspec-devel mailing list