Sha256: 05accb5abcf84f3d39f6fed717bc8b59cba2193742f177bf6ab6b46033d65df3

Contents?: true

Size: 1.45 KB

Versions: 21

Compression:

Stored size: 1.45 KB

Contents

begin
  require 'simplecov'
  SimpleCov.start
rescue LoadError
  # Don't care
end
require 'aruba/cucumber'
require 'fileutils'

# Adds GLI's bin dir to our path
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
GLI_LIB_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..','..','lib'))

GLI_GEMSET = 'gli-testing'
TMP_PATH = 'tmp/aruba'

Before do
  # Not sure how else to get this dynamically
  @dirs = [TMP_PATH]
  @aruba_timeout_seconds = 5
  @original_path = ENV['PATH'].split(File::PATH_SEPARATOR)
  @original_home = ENV['HOME']
  new_home = "/tmp/fakehome"
  FileUtils.rm_rf new_home
  FileUtils.mkdir new_home
  ENV['HOME'] = new_home
  FileUtils.cp 'gli.rdoc','gli.rdoc.orig'
end

After do |scenario|
  ENV['RUBYLIB'] = ''
  todo_app_dir = File.join(TMP_PATH,'todo')
  if File.exists? todo_app_dir
    FileUtils.rm_rf(todo_app_dir)
  end
  ENV['PATH'] = @original_path.join(File::PATH_SEPARATOR)
  ENV['HOME'] = @original_home
  ENV['TODO_SORT_HELP'] = nil
  ENV['TODO_WRAP_HELP_TEXT'] = nil
  FileUtils.mv 'gli.rdoc.orig','gli.rdoc'
end

def add_to_path(dir)
  ENV['PATH'] = "#{dir}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
end

def add_to_lib_path(path)
  ENV["RUBYLIB"] = (String(ENV["RUBYLIB"]).split(File::PATH_SEPARATOR) + [path]).join(File::PATH_SEPARATOR)
end

def remove_from_lib_path(path)
  ENV["RUBYLIB"] = (String(ENV["RUBYLIB"]).split(File::PATH_SEPARATOR) - [path]).join(File::PATH_SEPARATOR)
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
gli_aziz_light-2.8.1 features/support/env.rb
gli-2.8.1 features/support/env.rb
gli-2.8.0 features/support/env.rb
gli-2.7.0 features/support/env.rb
gli-2.6.2 features/support/env.rb
gli-2.6.1 features/support/env.rb
gli-2.6.0 features/support/env.rb
gli-2.6.0.rc1 features/support/env.rb
gli-2.5.6 features/support/env.rb
gli-2.5.5 features/support/env.rb
gli-2.5.4 features/support/env.rb
gli-2.5.3 features/support/env.rb
gli-2.5.2 features/support/env.rb
gli-2.5.1 features/support/env.rb
gli-2.5.0 features/support/env.rb
gli-2.4.1 features/support/env.rb
gli-2.4.0 features/support/env.rb
gli-2.3.0 features/support/env.rb
gli-2.3.0.rc1 features/support/env.rb
gli-2.2.1 features/support/env.rb