[rspec-users] Override tests (of a core rails app from a plugin)

Alex Chaffee alex at stinky.com
Sun Oct 2 15:41:33 EDT 2011

I'm not sure what you mean by "core code" and "the user" here. Are you
writing an app, or a library, or a plugin? If you're writing an app, you
should test the app's behavior, which includes all the plugins and however
you configured them; if you're writing a library you should have scenarios
that test the various configuration options and basic functionality.

If you're writing a Rails plugin, you should test how that plugin works
inside apps. One way to do this is to generate some toy rails apps, stick
them deep inside your "spec" directory somewhere, have them include your
plugin and configure it in various ways, then test that the toy apps perform
as expected. (Technically those would be integration tests, not unit tests,
and you don't want to write too many of them if you can test the bulk of
your code through unit tests.)

you could say "if the core tests without the plugin and the plugin tests
> with the plugin work, everything is fine", it doesn't work that well though.

If your app is using a plugin, then why (and how) would you ever test your
app without the plugin?

Alex Chaffee - alex at stinky.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111002/0e256164/attachment.html>

More information about the rspec-users mailing list