Permalink
Browse files

run the build with a clean Bundler environment

  • Loading branch information...
1 parent 28176de commit 32675bf8095d1eabed2c6d1813284743f073c182 @dcrec1 committed Jun 8, 2011
Showing with 10 additions and 3 deletions.
  1. +5 −3 app/models/project.rb
  2. +5 −0 spec/models/build_spec.rb
View
@@ -63,9 +63,11 @@ def last_commit
end
def run_build_command
- run "rvm gemset use #{name} >>"
- result = run "unset GEM_PATH && unset RUBYOPT && unset RAILS_ENV && unset BUNDLE_GEMFILE && #{build_command} >>"
- return result, File.open(log_path).read
+ Bundler.with_clean_env do
+ run "rvm gemset use #{name} >>"
+ result = run "unset GEM_PATH && unset RUBYOPT && unset RAILS_ENV && unset BUNDLE_GEMFILE && #{build_command} >>"
+ return result, File.open(log_path).read
+ end
end
def run_deploy
@@ -29,6 +29,11 @@
Build.create! :project => @project
end
+ it "should build the project with a clean Bundler env" do
+ Bundler.should_receive(:with_clean_env).and_yield
+ Build.create! :project => @project
+ end
+
it "should save the log" do
log = "Can't touch this!"
File.stub!(:open).with(@project.send :log_path).and_return(mock(Object, :read => log))

0 comments on commit 32675bf

Please sign in to comment.