Created
May 18, 2010 10:50
-
-
Save ashmoran/404870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before("@culerity,@celerity,@javascript") do |scenario| | |
unless @env_rvm_jruby | |
@env_rvm_jruby = {} | |
require 'yaml' | |
# NOTE: updated due to change in `rvm info` structure | |
# assumes JRuby 1.5, but no error checking if it's missing | |
rvm_info = YAML::load(`rvm info jruby`)['jruby-1.5.0'] | |
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'] | |
# NOTE: This has changed as @env_jruby_path was not being used | |
# ENV['PATH'] = ENV['PATH'] + ":" | |
ENV['PATH'] = @env_jruby_path + ":" + ENV['PATH'] | |
end | |
After("@culerity,@celerity,@javascript") do |scenario| | |
@env_defaults.each do |k, v| | |
ENV[k] = v | |
end | |
ENV["PATH"] = @env_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment