Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

run the build with a clean Bundler environment

  • Loading branch information...
commit 32675bf8095d1eabed2c6d1813284743f073c182 1 parent 28176de
@dcrec1 authored
Showing with 10 additions and 3 deletions.
  1. +5 −3 app/models/project.rb
  2. +5 −0 spec/models/build_spec.rb
View
8 app/models/project.rb
@@ -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
View
5 spec/models/build_spec.rb
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.