O'Reilly logo

Rails Plugins: Extending Rails Beyond the Core by James Adam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Testing Plugins

Once you’ve written your plugin, it’s essential that you provide tests that verify its behavior. Writing tests for plugins is for the most part identical to any testing in Rails or Ruby. This section discusses some special issues that must be taken into consideration to test plugins effectively.

Writing Plugin Tests

The plugin generator creates a test folder in your plugins (which we have happily ignored up to this point). However, the importance of testing your code cannot be overstated. Test-driven development not only can improve the reliability and maintainability of your code, but it can actually help you develop faster.

The test:plugins ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required