summaryrefslogtreecommitdiff
path: root/spec/runtime/with_clean_env_spec.rb
diff options
context:
space:
mode:
authorJoshua Hull <joshbuddy@gmail.com>2010-03-26 16:32:51 -0400
committerAndre Arko <andre@arko.net>2010-03-29 19:22:28 -0700
commit33154fd6865d5006a91381c92b7b83ba1c3b59cd (patch)
treecc4e6a015437268ccfdab6b36cb78c5b6f0b352b /spec/runtime/with_clean_env_spec.rb
parent5b9b2c3bc85f9cb5c1f29e7fd1c51a247e362c5b (diff)
downloadbundler-33154fd6865d5006a91381c92b7b83ba1c3b59cd.tar.gz
Add Bundler.with_clean_env for blocks of ruby without a bundled env
e.g. if you are in a bundled Rakefile but need to shell out to something on your system that uses ruby like Homebrew Fixes #225
Diffstat (limited to 'spec/runtime/with_clean_env_spec.rb')
-rw-r--r--spec/runtime/with_clean_env_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb
new file mode 100644
index 0000000000..3894e414a9
--- /dev/null
+++ b/spec/runtime/with_clean_env_spec.rb
@@ -0,0 +1,15 @@
+require File.expand_path('../../spec_helper', __FILE__)
+
+describe "Bundler.with_clean_env" do
+
+ it "should reset and restore the environment" do
+ gem_path = ENV['GEM_PATH']
+
+ Bundler.with_clean_env do
+ `echo $GEM_PATH`.strip.should_not == gem_path
+ end
+
+ ENV['GEM_PATH'].should == gem_path
+ end
+
+end \ No newline at end of file