public
Last active — forked from agibralter/culerity-hooks.rb

  • Download Gist
culerity-hooks.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Before("@culerity,@celerity,@javascript") do |scenario|
unless @env_rvm_jruby
@env_rvm_jruby = {}
require 'yaml'
rvm_info = YAML::load(`bash -l -c 'source ~/.rvm/scripts/rvm; rvm jruby ; rvm info'`)
rvm_info['environment'].each do |k, v|
@env_rvm_jruby[k] = v
end
@env_jruby_path = rvm_info['binaries']['ruby'].gsub(%r{^(.*)/ruby$}, '\1')
end
@env_defaults = {}
@env_rvm_jruby.each do |k, v|
@env_defaults[k] = ENV[k]
ENV[k] = v
end
@env_path = ENV['PATH']
ENV['PATH'] = ENV['PATH'] + ":#{@env_jruby_path}"
end
 
After("@culerity,@celerity,@javascript") do |scenario|
@env_defaults.each do |k, v|
ENV[k] = v
end
ENV["PATH"] = @env_path
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.