Improve test suite performance with aruba wrapper:

* Implement ArubaProgramWrapper in cucumber env;
* Tag a few features to not use the wrapper as aruba doesn't support yet
  interactive testing with in process mode, and reported program name
  will not be the correct one;
* Assign required standard streams to CLI and Env classes.
This commit is contained in:
Thibault Jouan
2014-05-28 15:13:30 +00:00
parent 55f18d30bf
commit 18b835b10e
5 changed files with 77 additions and 25 deletions

View File

@@ -9,27 +9,28 @@ module Producer
EX_SOFTWARE = 70
class << self
def run!(arguments, output: $stderr)
cli = new(arguments)
def run!(arguments, stdin: $stdin, stdout: $stdout, stderr: $stderr)
cli = new(arguments, stdin: stdin, stdout: stdout, stderr: stderr)
begin
cli.parse_arguments!
cli.run
rescue ArgumentError
output.puts USAGE
stderr.puts USAGE
exit EX_USAGE
rescue RuntimeError => e
output.puts "#{e.class.name.split('::').last}: #{e.message}"
stderr.puts "#{e.class.name.split('::').last}: #{e.message}"
exit EX_SOFTWARE
end
end
end
attr_reader :arguments, :stdout, :env
attr_reader :arguments, :stdin, :stdout, :stderr, :env
def initialize(args, stdout: $stdout)
def initialize(args, stdin: $stdin, stdout: $stdout, stderr: $stderr)
@arguments = args
@stdin = stdin
@stdout = stdout
@env = Env.new(output: stdout)
@env = Env.new(input: stdin, output: stdout)
end
def parse_arguments!