Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
make tests pass under travis.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
echohead committed May 2, 2012
1 parent 52abb77 commit f34f86a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Rakefile
Expand Up @@ -12,6 +12,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
Expand Down Expand Up @@ -117,7 +121,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

Expand Down

0 comments on commit f34f86a

Please sign in to comment.