[rspec-users] getting storyrunner success/failure status in rake task

Korny Sietsma korny at sietsma.com
Wed Apr 16 00:02:03 EDT 2008

Hi folks - I'm trying to build a rake task to run our plain-text
stories, both from a normal build and from our continuous integration

However, I'm having a problem - running all.rb doesn't return any sort
of success/failure - so a broken story doesn't indicate to Cruise
Control that the build is broken.

Currently the rake task is:
  desc "Run all stories"
  task :stories do
        output = "#{ARTIFACT_DIR}/doc/rspec/story_results.txt"
        ruby "#{RAILS_ROOT}/stories/all.rb"

and all.rb calls story files which do the standard sort of thing:
require File.dirname(__FILE__) + "/helper"

with_steps_for(:stuff, :morestuff) do
  run_local_story "my_first_story", :type => RailsStory

I'm going to try switching to Kyle Hargrave's story runner stuff - but
it's unclear to me if this has any sort of success/fail indicator

Any suggestions on how to get the above to return a failure code, or
throw an exception?  I've seen stuff in the code relating to
Spec::Story::World.errors() - but I can't seem to work out how to
access this.

(Oh, and I'm very new to rspec stories, and somewhat new to rake
tasks, so forgive me if I'm missing something obvious)

- Korny

Kornelis Sietsma korny at my surname dot com
kornys at gmail dot com on google chat -- kornys on skype
"we do what we must, because we can"

More information about the rspec-users mailing list