[Rspec-devel] separation of components

Jim Weirich jim.weirich at gmail.com
Tue Sep 5 11:12:25 EDT 2006

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.


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

* 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.

-- 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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060905/23997bf2/attachment-0001.html 

More information about the Rspec-devel mailing list