Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Stepwise operation for rspec
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
lib
spec
spec_help
.gitignore
.rspec
Gemfile
Gemfile.lock
LICENSE
README
Rakefile
rspec-steps.gemspec

README

== RSpec Steps
=== ( or: why would I want to relearn how to write specs? )

RSpec Steps allows you to chain examples into a series of steps without having 
to go the whole 9 yards over to Cucumber.  It's often incredibly useful to be 
able to aseemble a series of tests that should all pass, but where completely 
isolating them is less than sensible.

One excellent example is web site integration tests.  With RSpec steps you can 
do:

  steps "Add a user" do
    it do
      visit root
      page.should have_text "Login"
    end

    it do
      fill_in :name, "Johnny User"
      click "Login"
      page.should have_text "Welcome, Johnny!"
    end
    
    ...
  end

Add dozens of steps to a set.  They get run in order, and the state of the 
tests isn't reset between them.  Better still, if one step fails, the rest are 
all marked "pending" so they don't even try to run, which helps speed up 
testing.
Something went wrong with that request. Please try again.