This article is an introduction to testing Rails plugins.
Simplifies plugin testing by creating an isolated Rails environment that simulates its usage in a real application
A surprisingly large number of plugins have no tests at all. Part of the reason might be that writing a plugin test is a little bit harder than writing a normal unit test.
Unfortunately, by default plugin tests are pretty bland. They use the plain unit test suite supplied by Ruby, and not any of the extended Rails test framework. This will leave our plugin’s test classes with no access to fixtures, database.yml configuration, or any of those nice class auto-loading features.
In this presentation, I demoed Cucumber and Webrat. I also talked about Integrity and how I like to put it all together.
Or, you can test your Rack application (or Sinatra, or Rails, or Merb) using arbitrary HTTP client libraries, to check interoperability.
Trample is a more flexible load simulator. Instead of a static list of urls, trample's configuration language is ruby. Using ruby's blocks (lambda functions), it's possible to randomize the requests that get made in each thread, as well as the user that logs in.
Here are eight things my team has found to be true after working with Cucumber for about 6 months.
Rake tasks to run specs and tests in parallel, to use multiple CPUs and speedup test runtime.
We had a conversation about the fact that the 'TDD is about testing vs TDD is about design" debate that keeps popping up, especially now in the Ruby community.
A/Bingo is a Ruby on Rails A/B testing framework written as a plugin.
Celerity is a JRuby wrapper around HtmlUnit – a headless Java browser with JavaScript support. It provides a simple API for programmatic navigation through web applications. Celerity aims at being API compatible with Watir.
Write declarative tests using nested contexts without performance penalties. Contest is less than 100 lines of code and gets the job done.
What if my controller decides to take the Thing.create! and rescue route? What if my model has a special initializer method, like Thing.build_with_foo? My spec for behavior should not fail if I change the implementation.
I've recently moved from using Parallels for browser testing to Sun's Open Source VirtualBox. Here's a walkthrough on how to get a browser testing suite for free on OSX or Ubuntu.
Passing the --profile flag to RSpec produces some additional output, namely the running times of the ten slowest examples in your specs.