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

Felix Schäfer f.schaefer at finn.de
Sun Oct 2 14:57:19 EDT 2011


Am 01.10.2011 um 22:17 schrieb Justin Ko:

> Specs do not over-ride each other

That's what I was able to gather so far, unfortunately.

> , so I can't think of an easy to do what you're trying to do. With that said, I have never come across a situation like this because usually the app has one or the other. Shouldn't the user delete their own code that your plugin accomplishes after they install it? Or, maybe your plugin overrides their core functionality, but doesn't provide tests - in which case it's up to the user to adjust their tests to your plugin.

The point is that a plugin can change core code but not core tests, making the core tests virtually useless. I'm aware that the preferred solution would probably be to test the core app and the plugins independently, or at least that the plugins only test what they change so that 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. Changes introduced by plugins might slightly change other behaviors and have unintended (and thus not tested by the plugin's tests) side-effects which the core tests might catch, if those are known to break because of intentional changes to the core by the plugin, they're of no use.

Felix


More information about the rspec-users mailing list