[rspec-users] command line options in story runner run method

David Chelimsky dchelimsky at gmail.com
Mon Aug 18 13:07:40 EDT 2008

On Mon, Aug 18, 2008 at 12:01 PM, aidy lewis <aidy.lewis at googlemail.com> wrote:
> Hi,
> 2008/8/18 aidy lewis <aidy.lewis at googlemail.com>:
>> Hi,
>> Can anyone give me some sample syntax of using a command line switch
>> in the Story Runner run method please?
> This is what I have
> def run_local_story(filename, options={})
>  options = {"-fh:" => "C:/rspec_reports/#{filename}.htm"}
>  run File.join(File.dirname(__FILE__), "../projects/#{filename}"), options
> end

Those options don't make it to the runner, which reads the actual
command line (ARGV).

What I typically do is load up runner files that look like this:

# stories/accounting/stories.rb
with_steps_for :accounting do
  run 'path/to/a/story/file'

The, in a terminal:

$ ruby stories/accounting/stories.rb -fh:/rspec_reports/#{filename}.htm


> However, no exception is thrown, but neither is a file created. I am
> also unsure on what part of the code the html report should be
> created.
> Aidy
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list