[rspec-users] Command line story runner

Kyle Hargraves philodespotos at gmail.com
Fri Apr 4 21:19:20 EDT 2008

On Fri, Apr 4, 2008 at 5:21 PM, Joe Van Dyk <joe at pinkpucker.net> wrote:
> On Thu, Apr 3, 2008 at 7:58 AM, Kyle Hargraves <philodespotos at gmail.com> wrote:
>  > Hullo all,
>  >
>  >  It sucks to write wrapper .rb files just so stories/all.rb can find
>  >  and run them.
>  Here's what my stories/all.rb looks like:
>  require File.dirname(__FILE__) + '/helper'
>  Dir[File.dirname(__FILE__) + '/../steps/*.rb'].each { |f| require f }
>  with_steps_for(:general, :sessions, :blogs, :game_moderation,
>  :user_completed_games, :searching, :puzzles, :user_media) do
>   run_local_story "blog_story"
>   run_local_story "user_completed_games_story"
>   run_local_story "searching_story"
>   run_local_story "puzzle_story"
>   run_local_story "picathon_uploads_story"
>   #run_local_story "game_moderation_story"
>  end
>  Last one is commented out, since I just added a bunch of ajaxy stuff
>  to the pages and haven't converted the stories over to ajax yet (if
>  that's possible).
>  Each one of the steps corresponds to a controller step file that's in
>  /steps.  Works pretty well, not much of a hassle running stories.
>  This is for http://tanga.com.
>  Joe

This works for a while, and it's what I started with. But it didn't
scale in my experience.

Firstly, I started using the same wording for steps, but they had
different meanings by context; you can no longer just include
everything, or you can end up running the wrong step.

Moreover, one of my current suites has about 180 scenarios, which
takes a minute and a half or so to run all the way through. When I'm
working on a single feature, I don't want to run 90% of the scenarios,
just one or two of the stories surrounding that feature. all.rb makes
that impossible, AFAIK. So you start writing individual .rb files you
can run separately, which all.rb just sources. I ended up spending a
lot of time managing the infrastructure instead of getting work done.
brynary's script/story relieved that headache for me.

BTW, what is run_local_story?


More information about the rspec-users mailing list