Testing Rails gem plugins using cucumber can be difficult since gems need to be tested in the context of a host Rails application, which isn't part of your gem. Cukigem gives you cucumber steps to make testing your gem in the context of a Rails application easy.
This is a nice addition to gems as it's more of an integration test - verifying that your gem actually works and is successfully-installed in a Rails application via the Gemfile.
This is not a gem but a collection of useful steps. Simply copy the step definition files located in step_definitions, and the support files located in support, into your own project.
See this example in use on my message_block project. All of the step definitions should be self-explanatory if you read the step_definitions/cukigem_steps.rb file.
Be careful when using multiple “generate a rails application” steps in one test run. The problem is that we can only require the config/environment.rb file once, so if you blow away and generate a new application in the course of the test run, things will not behave as expected. Cukigem does a lot to “reset” your app to a blank state so there should rarely be a need to fully generate a new application except if one doesn't already exist.
I am really looking for contributions here. I created this after looking for a standard way of testing my gems using cucumber and I was unable to find anything (except for some nice code in the paperclip project which did most of what I needed). Patches/pull-requests welcome.
Thanks to Jon Yurek of Thoughtbot for getting me thinking about this after seeing his work on Rails app generation and cucumber within the paperclip project.