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 'aruba/in_process'
|
||||||
require 'producer/core'
|
require 'producer/core'
|
||||||
|
|
||||||
|
|
||||||
class ArubaProgramWrapper
|
class ArubaProgramWrapper
|
||||||
def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr,
|
def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr,
|
||||||
kernel = Kernel)
|
kernel = Kernel)
|
||||||
@ -23,11 +22,13 @@ class ArubaProgramWrapper
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Raise aruba default timeout so test suite can run on a slow machine.
|
||||||
Before do
|
Before do
|
||||||
@_sshd_fast = true
|
@aruba_timeout_seconds = 8
|
||||||
end
|
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
|
Before('@exec') do
|
||||||
Aruba.process = Aruba::SpawnProcess
|
Aruba.process = Aruba::SpawnProcess
|
||||||
end
|
end
|
||||||
@ -36,3 +37,15 @@ Before('~@exec') do
|
|||||||
Aruba::InProcess.main_class = ArubaProgramWrapper
|
Aruba::InProcess.main_class = ArubaProgramWrapper
|
||||||
Aruba.process = Aruba::InProcess
|
Aruba.process = Aruba::InProcess
|
||||||
end
|
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