Sha256: ea4a8ade6670dd2729d11158248c4a47a0e87316402422fef667c84e481e2f5f

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require 'active_support'
require 'nokogiri'
require 'rspec'
require 'aruba/cucumber'
require 'pry'

PROJECT_ROOT          = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
TEMP_DIR              = File.join(PROJECT_ROOT, 'tmp').freeze
LOCAL_RAILS_ROOT      = File.join(TEMP_DIR, 'rails_root').freeze
RACK_FILE             = File.join(TEMP_DIR, 'rack_app.rb').freeze
LAST_NOTICE           = File.join(PROJECT_ROOT, 'resources', 'notice.xml')
ORIGINAL_RACK_FILTERS = File.join(PROJECT_ROOT, 'lib', 'airbrake', 'utils', 'rack_filters.rb')

Before do
  FileUtils.rm_rf(LOCAL_RAILS_ROOT)

  reload_rack_filters
end

When /^I reset Bundler environment variable$/ do
  BUNDLE_ENV_VARS.each do |key|
    ENV[key] = nil
  end
end

def prepend_path(path)
  ENV['PATH'] = path + ":" + ENV['PATH']
end

def reload_rack_filters
  original_filters = File.read(ORIGINAL_RACK_FILTERS)

  File.write(File.join(TEMP_DIR, "rack_filters.rb"), 
             original_filters.lines[1..-2].join("\n"))

  require File.join(TEMP_DIR, "rack_filters.rb")
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
airbrake-3.1.16 features/support/env.rb
airbrake-3.1.15 features/support/env.rb