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

@@ -1,2 +1,34 @@
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