Path: | README.rdoc |
Last Update: | Sun Oct 18 22:53:25 -0500 2009 |
Spectie (rhymes with "necktie") is a pure Ruby BDD integration testing framework for RSpec.
Spectie was written with the following beliefs:
Spectie tries to strike the proper balance between writing readable tests, and just getting your work done in the most efficient way possible. It does this by providing a consistent structure for writing your integration test code in a BDD fashion, with the breakdown of features, scenarios, and their given/when/then statements. However, a little bit of syntactic sugar goes a long way to aid in the understanding of code, while too much can add unnecessary complexity and actually decrease maintainability. So, Spectie keeps things pretty close to the underlying technology at all times, since most of the time, it‘s a developer that‘s really writing the tests.
With these ideas in mind, what Spectie provides is:
Advantages of having your integration tests written with Spectie:
Feature "Compelling Feature" do Scenario "As a user, I would like to use a compelling feature" do Given :i_have_an_account And :i_have_logged_in When :i_access_a_compelling_feature Then :i_am_presented_with_stunning_results end def i_have_an_account @user = create_user end def i_have_logged_in log_in_as @user end def i_access_a_compelling_feature get compelling_feature_path response.should be_success end def i_am_presented_with_stunning_results response.should have_text("Simply stunning!") end end
sudo gem install spectie
script/plugin install git://github.com/ryankinderman/spectie.git
git clone git://github.com/ryankinderman/spectie.git
In spec/spec_helper.rb, after require ‘spec/rails‘, add:
require 'spectie/rails'
That‘s it. Spectie registers itself with RSpec, so you can run your integration tests with the usual rake spec:integration command. Also, all of the usual methods in a Rails integration testing session are available for you to use as well.
TODO
Ryan Kinderman (ryan@kinderman.net)
Copyright (c) 2009 Ryan Kinderman. See LICENSE for details.