[rspec-users] HTML Story Formatter

Christopher Bailey chris at cobaltedge.com
Thu Jul 24 12:29:41 EDT 2008

For another variant, with my CC.rb setup, I have a rake task as follows:

  desc "Copy RSpec Story HTML includes"
  task :copy_story_html_includes do
      stories_output_dir = File.join(ENV['CC_BUILD_ARTIFACTS'], 'Stories')
      system "mkdir #{stories_output_dir}"
      system("/bin/cp -r
      system("/bin/cp -r

And then I just have that as a pre-requisite to my regular
spec:stories rake task (since it'll only do something if we're in the
CC.rb environment):

  desc "Run all spec stories"
  task :stories => [ :copy_story_html_includes ] do
      ruby "stories/all.rb --format html >
#{File.join(ENV['CC_BUILD_ARTIFACTS'], 'Stories', 'index.html')}"
      ruby "stories/all.rb --format plain --colour"

On Thu, Jul 24, 2008 at 5:44 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
> On Thu, Jul 24, 2008 at 7:32 AM, Jonathan Leighton
> <j at jonathanleighton.com> wrote:
>> Hiya,
>> I am trying to use the HTML Story Formatter in conjunction with
>> CruiseControl.rb. I have got it outputting the stories to a file, but I
>> notice there are CSS and JS files linked in the head, which don't appear
>> to be anywhere in the rspec repository. Are these files available and if
>> so where?
> They're in the story_server directory. We haven't automated this yet,
> so what I do is just copy them to a logical place and set up a rake
> task to put the stories in the same place. On Rails projects, I've
> gotten into the habit of putting them in
> public/doc/[javascripts|stylesheets] (or similar) and then use this
> rake task.
> namespace :stories do
>  desc "Run all the stories (HTML)"
>  task :html do
>    sh "ruby stories/all.rb -fh:public/doc/index.html"
>  end
> end
> Now the customers can see the story output at /docs. Of course, so can
> anybody else, so that might come down before releasing or move to a
> controller that can manage who gets to see it. But this should give
> you an idea.
> Also note that the javascript is 1/2 baked at this point and includes
> an "add step" (non) feature (which you'll see in the browser) that
> doesn't really do anything.
> Maybe it's time to get rid of that for now and standardize on where
> this stuff goes :)
> HTH,
> David
>> Cheers,
>> Jon
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Christopher Bailey
Cobalt Edge LLC

More information about the rspec-users mailing list