diff options
author | Tim Miller <tim.miller.0@gmail.com> | 2012-05-02 09:43:37 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2012-05-27 19:38:31 -0700 |
commit | 270016c2ccd5c9ecadc77c7859c386a364dfb033 (patch) | |
tree | 509da5c7bc9ae1ade80df41217a44ed892ee4f95 | |
parent | 5799ae890752c1c2977e9fb232520a0806e063c2 (diff) | |
download | bundler-270016c2ccd5c9ecadc77c7859c386a364dfb033.tar.gz |
make tests pass under travis.
sudo tests were failing under travis because they were not
being run as root. this change runs the root tests as root,
and chowns the tests' "tmp" directory back to the original
user to allow the subsequent 'realworld' tests to pass.
-rw-r--r-- | Rakefile | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -11,6 +11,10 @@ rescue false end +def sudo_task(task) + system("sudo -E rake #{task}") +end + namespace :spec do desc "Ensure spec dependencies are installed" task :deps do @@ -116,7 +120,8 @@ begin Rake::Task["spec:rubygems:#{rg}"].reenable puts "\n\e[1;33m[Travis CI] Running bundler sudo specs against rubygems #{rg}\e[m\n\n" - sudos = safe_task { Rake::Task["spec:rubygems:#{rg}:sudo"].invoke } + sudos = sudo_task "spec:rubygems:#{rg}:sudo" + chown = system("sudo chown -R #{ENV['USER']} #{File.join(File.dirname(__FILE__), 'tmp')}") Rake::Task["spec:rubygems:#{rg}"].reenable |