Skip to content

Commit

Permalink
Use the new hooks to uninstall gems if they fail testing.
Browse files Browse the repository at this point in the history
Bump the rubygems requirement to 1.5 to reflect above changes.
  • Loading branch information
Erik Hollensbe committed Apr 17, 2011
1 parent 4594942 commit 441aa6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec = Hoe.spec 'rubygems-test' do
pluggable! pluggable!


require_ruby_version ">= 1.8.7" require_ruby_version ">= 1.8.7"
require_rubygems_version ">= 1.3.6" require_rubygems_version ">= 1.5.0"


extra_deps << ['rake', '>= 0.8.7'] extra_deps << ['rake', '>= 0.8.7']


Expand Down
5 changes: 2 additions & 3 deletions lib/rubygems/on_install_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Gem.autoload(:RakeNotFoundError, 'exceptions') Gem.autoload(:RakeNotFoundError, 'exceptions')
Gem.autoload(:TestError, 'exceptions') Gem.autoload(:TestError, 'exceptions')


Gem.post_install do |gem| Gem.post_build do |gem|
options = Gem.configuration["test_options"] || { } options = Gem.configuration["test_options"] || { }


if options["auto_test_on_install"] or options["test_on_install"] if options["auto_test_on_install"] or options["test_on_install"]
Expand All @@ -17,8 +17,7 @@
options["force_uninstall_on_failure"] or options["force_uninstall_on_failure"] or
gem.ui.ask_yes_no("Testing #{gem.spec.name} (#{gem.spec.version}) failed. Uninstall?", false) gem.ui.ask_yes_no("Testing #{gem.spec.name} (#{gem.spec.version}) failed. Uninstall?", false)


# FIXME ask drbrain how to do this more better. false
at_exit { Gem::Uninstaller.new(gem.spec.name, :version => gem.spec.version).uninstall }
end end
end end
end end
Expand Down
1 change: 0 additions & 1 deletion test/test_execute.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,5 +81,4 @@ def test_07_upload_results?
ensure ensure
Gem.configuration.verbose = old_verbose Gem.configuration.verbose = old_verbose
end end

end end

0 comments on commit 441aa6f

Please sign in to comment.