Sha256: a41543fd78244f5cc7061dae74e47f5be0226f73cb8e10b954761aaa6405c9d3

Contents?: true

Size: 1006 Bytes

Versions: 15

Compression:

Stored size: 1006 Bytes

Contents

# Set up the environment for testing
require 'aruba/cucumber'
require 'kitchen'

Before do
  @aruba_timeout_seconds = 15
  @cleanup_dirs = []
end

After do |s|
  # Tell Cucumber to quit after this scenario is done - if it failed.
  # This is useful to inspect the 'tmp/aruba' directory before any other
  # steps are executed and clear it out.
  Cucumber.wants_to_quit = true if s.failed?

  # Restore environment variables to their original settings, if they have
  # been saved off
  ENV.keys.select { |key| key =~ /^_CUKE_/ }.each do |backup_key|
    ENV[backup_key.sub(/^_CUKE_/, '')] = ENV.delete(backup_key)
  end

  @cleanup_dirs.each { |dir| FileUtils.rm_rf(dir) }
end

def backup_envvar(key)
  ENV["_CUKE_#{key}"] = ENV[key]
end

def restore_envvar(key)
  ENV[key] = ENV.delete("_CUKE_#{key}")
end

def unbundlerize
  keys = %w[BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT]

  keys.each { |key| backup_envvar(key) ; ENV.delete(key) }
  yield
  keys.each { |key| restore_envvar(key) }
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
test-kitchen-1.1.1 features/support/env.rb
test-kitchen-1.1.0 features/support/env.rb
test-kitchen-1.0.0 features/support/env.rb
test-kitchen-1.0.0.rc.2 features/support/env.rb
test-kitchen-1.0.0.rc.1 features/support/env.rb
test-kitchen-1.0.0.beta.4 features/support/env.rb
test-kitchen-1.0.0.beta.3 features/support/env.rb
test-kitchen-1.0.0.beta.2 features/support/env.rb
test-kitchen-1.0.0.beta.1 features/support/env.rb
test-kitchen-1.0.0.alpha.7 features/support/env.rb
test-kitchen-1.0.0.alpha.6 features/support/env.rb
test-kitchen-1.0.0.alpha.5 features/support/env.rb
test-kitchen-1.0.0.alpha.4 features/support/env.rb
test-kitchen-1.0.0.alpha.3 features/support/env.rb
test-kitchen-1.0.0.alpha.2 features/support/env.rb