Merge cucumber env setup in a unique file
This commit is contained in:
parent
a9c8485d09
commit
ed01bbed4e
@ -2,7 +2,6 @@ require 'aruba/cucumber'
|
||||
require 'aruba/in_process'
|
||||
require 'producer/core'
|
||||
|
||||
|
||||
class ArubaProgramWrapper
|
||||
def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr,
|
||||
kernel = Kernel)
|
||||
@ -23,11 +22,13 @@ class ArubaProgramWrapper
|
||||
end
|
||||
|
||||
|
||||
# Raise aruba default timeout so test suite can run on a slow machine.
|
||||
Before do
|
||||
@_sshd_fast = true
|
||||
@aruba_timeout_seconds = 8
|
||||
end
|
||||
require 'cucumber/sshd/cucumber'
|
||||
|
||||
# Use aruba "in process" optimization only for scenarios not tagged @exec.
|
||||
# We need a real process in a few cases: real program name, interactive usage…
|
||||
Before('@exec') do
|
||||
Aruba.process = Aruba::SpawnProcess
|
||||
end
|
||||
@ -36,3 +37,15 @@ Before('~@exec') do
|
||||
Aruba::InProcess.main_class = ArubaProgramWrapper
|
||||
Aruba.process = Aruba::InProcess
|
||||
end
|
||||
|
||||
# Fake home directory for @fake_home tagged scenarios.
|
||||
Before('@fake_home') do
|
||||
ENV['HOME'] = File.expand_path(current_dir)
|
||||
end
|
||||
|
||||
# Enable cucumber-sshd "fast" mode (persists sshd across scenarios), and
|
||||
# register hooks for @sshd tagged scenarios.
|
||||
Before do
|
||||
@_sshd_fast = true
|
||||
end
|
||||
require 'cucumber/sshd/cucumber'
|
||||
|
@ -1,3 +0,0 @@
|
||||
Before do
|
||||
@aruba_timeout_seconds = 8
|
||||
end
|
@ -1,3 +0,0 @@
|
||||
Before('@fake_home') do
|
||||
ENV['HOME'] = File.expand_path(current_dir)
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user