[Rspec-devel] separation of components

David Chelimsky dchelimsky at gmail.com
Tue Sep 5 11:29:54 EDT 2006

On 9/5/06, Jim Weirich <jim.weirich at gmail.com> wrote:
> On 9/5/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> >
> > Definitely. We've actually been talking internally about providing
> > adapters for Flexmock and Mocha.
> Great!
> > Do you have any thoughts about this?
> Here are some thoughts off the top of my head.
> * I will need a way to tie into  test teardown to handle mock verification.
> With Test::Unit, I include FlexMock::TestCase which overrides the teardown
> method with my own.  Its a bit fragile, for if the user defined a test
> specific teardown and doesn't invoke "super", my teardown code will be
> missed.
> * I use assert_xxx in several places in FlexMock.  This won't work with
> RSpec (obviously), but I think it could easily be abstracted into a bridge
> that asserts properly in either RSpec or Test::Unit.
> * I also rescue (and rethrow)
> Test::Unit::AssertionFailedError to add extra information
> to the generic Test::Unit assertion failed message ( e.g. the name of the
> mock that failed).  I would probably need to do something similar in RSpec.
> That's all I can think of at the moment.  Right now, flexmock is pretty
> tightly in bed with Test::Unit, but I wouldn't mind shaking it loose a bit.

Ah - I hadn't considered the messaging. I was thinking the only issues
would be capturing creation of new mocks and being able to explicitly
control verification.

I'm in the process of creating a clean separation between the rspec
mock framework and the rest of rspec. This should provide some insight
as to how we'd like to see this work. I'll let you know how that


> --
> -- Jim Weirich    jim at weirichhouse.org     http://onestepback.org
> -----------------------------------------------------------------
> "Beware of bugs in the above code; I have only proved it correct,
> not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the Rspec-devel mailing list