stephanie
2009-Apr-22 21:06 UTC
[rspec-users] Passing custom arguments to an rspec script. Is this possible?
Hi, I am writing a rspec script to use with selenium-client. I would like to pass the script some custom arguments in the command line to change a few test settings in the script. However, rspec gives errors when I pass arguments to the script because rspec does not expect them. Is there any way I can pass custom arguments to an rspec script? Thanks, Stephanie
David Chelimsky
2009-Apr-22 23:37 UTC
[rspec-users] Passing custom arguments to an rspec script. Is this possible?
On Wed, Apr 22, 2009 at 4:06 PM, stephanie <ginormous at gmail.com> wrote:> Hi, > > I am writing a rspec script to use with selenium-client. I would like > to pass the script some custom arguments in the command line to change > a few test settings in the script. However, rspec gives errors when I > pass arguments to the script because rspec does not expect them. Is > there any way I can pass custom arguments to an rspec script?Arbitrary arguments, no. You can require arbitrary files though: spec --require path/to/config/file my_script.rb In which case you could configure things in different config files. Would that work for you?> > Thanks, > Stephanie > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2009-Apr-22 23:39 UTC
[rspec-users] Passing custom arguments to an rspec script. Is this possible?
On Wed, Apr 22, 2009 at 6:37 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Wed, Apr 22, 2009 at 4:06 PM, stephanie <ginormous at gmail.com> wrote: >> Hi, >> >> I am writing a rspec script to use with selenium-client. I would like >> to pass the script some custom arguments in the command line to change >> a few test settings in the script. However, rspec gives errors when I >> pass arguments to the script because rspec does not expect them. Is >> there any way I can pass custom arguments to an rspec script? > > Arbitrary arguments, no. You can require arbitrary files though: > > spec --require path/to/config/file my_script.rb > > In which case you could configure things in different config files. > > Would that work for you?The other alternative would be: ruby my_script.rb --custom-arg To get that to work, the args have to come after my_script.rb and my_script.rb would need to require ''spec/autorun''.> >> >> Thanks, >> Stephanie >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >
stephanie
2009-Apr-23 00:31 UTC
[rspec-users] Passing custom arguments to an rspec script. Is this possible?
Thanks, I''ll check out both options. -Stephanie On Apr 22, 4:37?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Wed, Apr 22, 2009 at 4:06 PM, stephanie <ginorm... at gmail.com> wrote: > > Hi, > > > I am writing a rspec script to use with selenium-client. I would like > > to pass the script some custom arguments in the command line to change > > a few test settings in the script. However, rspec gives errors when I > > pass arguments to the script because rspec does not expect them. Is > > there any way I can pass custom arguments to an rspec script? > > Arbitrary arguments, no. You can require arbitrary files though: > > spec --require path/to/config/file my_script.rb > > In which case you could configure things in different config files. > > Would that work for you? > > > > > Thanks, > > Stephanie > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users