Fix bootable scenario arguments for OptionParser

This commit is contained in:
Grzegorz Bizon 2017-11-10 11:11:22 +00:00 committed by Rémy Coutable
parent 8331786cfa
commit a396030a14
2 changed files with 4 additions and 6 deletions

View File

@ -4,4 +4,4 @@ require_relative '../qa'
QA::Scenario
.const_get(ARGV.shift)
.launch!(*ARGV)
.launch!(ARGV)

View File

@ -11,6 +11,8 @@ module QA
module ClassMethods
def launch!(argv)
return self.perform(*argv) unless has_attributes?
arguments = OptionParser.new do |parser|
options.to_a.each do |opt|
parser.on(opt.arg, opt.desc) do |value|
@ -21,11 +23,7 @@ module QA
arguments.parse!(argv)
if has_attributes?
self.perform(**Runtime::Scenario.attributes)
else
self.perform(*argv)
end
self.perform(**Runtime::Scenario.attributes)
end
private