Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Testing

Francisco Garcia edited this page Aug 15, 2014 · 1 revision

Instead of having a central project mounting every gem and providing some testing, it is normally more convenient if each gem is as self dependent as possible, including their own testing.

Since the base gem is always mounted at the root '/', all other app gems must have their own prefix.

Only the base gem shows some testing configuration for MiniTest and RSpec.

Although I am not a MiniTest user myself, I wanted to write the shortest possible test that loads a Padrino with Rack mock to query the routes for testing.

The RSpec example shows two styles of testing with Capybara. Normally my spec folder contains three type of tests:

  • spec/unit Unit tests not requiring Sinatra/Rails/Padrino
  • spec/integration Tests that do require Sinatra/Rails/Padrino running
  • spec/feature Tests around a feature and not a specific module or class. Similar to Cucumber but using RSpec with a more verbose syntax in a RDD spirit
Clone this wiki locally