Thibault Jouan 18b835b10e 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.
2014-05-30 23:14:00 +00:00

35 lines
695 B
Ruby

require 'aruba/cucumber'
require 'aruba/in_process'
require 'cucumber/sshd/cucumber'
require 'producer/core'
class ArubaProgramWrapper
def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr,
kernel = Kernel)
@argv = argv
@stdin = stdin
@stdout = stdout
@stderr = stderr
@kernel = kernel
end
def execute!
Producer::Core::CLI.run!(
@argv.dup, stdin: @stdin, stdout: @stdout, stderr: @stderr
)
rescue SystemExit => e
@kernel.exit(e.status)
end
end
Before('@exec') do
Aruba.process = Aruba::SpawnProcess
end
Before('~@exec') do
Aruba::InProcess.main_class = ArubaProgramWrapper
Aruba.process = Aruba::InProcess
end