Skip to content

nyarly/rspec-steps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

== 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.

About

Stepwise operation for rspec

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages