Skip to content

Commit

Permalink
experiment! Bring back shims around aruba to its previous state for
Browse files Browse the repository at this point in the history
older Rails
  • Loading branch information
pirj committed Jul 21, 2020
1 parent 45a1451 commit 839bce4
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions features/support/env.rb
Expand Up @@ -2,13 +2,27 @@
require 'fileutils'

module ArubaExt
def run_command(cmd, timeout = nil)
exec_cmd = cmd =~ /^rspec/ ? "bin/#{cmd}" : cmd
unset_bundler_env_vars
# Ensure the correct Gemfile and binstubs are found
in_current_directory do
with_unbundled_env do
super(exec_cmd, timeout)
if defined?(Aruba::VERSION) && Aruba::VERSION >= '0.14.12'
def run_command(cmd, timeout = nil)
exec_cmd = cmd =~ /^rspec/ ? "bin/#{cmd}" : cmd
unset_bundler_env_vars
# Ensure the correct Gemfile and binstubs are found
in_current_directory do
with_unbundled_env do
super(exec_cmd, timeout)
end
end
end
else
def run(cmd, timeout = nil)
exec_cmd = cmd =~ /^rspec/ ? "bin/#{cmd}" : cmd
super(exec_cmd, timeout)
end
# This method overrides Aruba 0.5.4 implementation so that we can reset Bundler to use the sample app Gemfile
def in_current_dir(&block)
Bundler.with_clean_env do
_mkdir(current_dir)
Dir.chdir(current_dir, &block)
end
end
end
Expand Down Expand Up @@ -41,12 +55,18 @@ def env_to_h
end
end

World(ArubaExt)

Aruba.configure do |config|
config.exit_timeout = 30
if defined?(Aruba::VERSION) && Aruba::VERSION >= '0.14.12'
Aruba.configure do |config|
config.exit_timeout = 30
end
else
Before do
@aruba_timeout_seconds = 30
end
end

World(ArubaExt)

unless File.directory?('./tmp/example_app')
system "rake generate:app generate:stuff"
end
Expand Down

0 comments on commit 839bce4

Please sign in to comment.