Index: hoe-2.5.0/test/test_hoe_gemcutter.rb =================================================================== --- hoe-2.5.0.orig/test/test_hoe_gemcutter.rb +++ hoe-2.5.0/test/test_hoe_gemcutter.rb @@ -1,3 +1,5 @@ +require "hoe" +begin require "hoe/gemcutter" unless defined? Hoe::Gemcutter class TestHoeGemcutter < MiniTest::Unit::TestCase @@ -11,3 +13,5 @@ class TestHoeGemcutter < MiniTest::Unit: # TODO add tests for push once using Gem::Commands::Push (waiting on rubygems release) end +rescue LoadError +end Index: hoe-2.5.0/test/test_hoe.rb =================================================================== --- hoe-2.5.0.orig/test/test_hoe.rb +++ hoe-2.5.0/test/test_hoe.rb @@ -49,27 +49,36 @@ class TestHoe < MiniTest::Unit::TestCase assert_equal 'blah', spec.rubyforge_project assert_equal Gem::RubyGemsVersion, spec.rubygems_version assert_match(/^Hoe.*Rakefiles$/, spec.summary) - assert_equal files.grep(/^test/), spec.test_files + assert_equal files.grep(/^test/).sort, spec.test_files.sort deps = spec.dependencies.sort_by { |dep| dep.name } - assert_equal %w(gemcutter hoe rubyforge), deps.map { |dep| dep.name } + expected_deps = %w(hoe) + expected_deps << "rubyforge" if Gem.loaded_specs.has_key? 'rubyforge' + expected_deps << "gemcutter" if Gem.loaded_specs.has_key? 'gemcutter' + expected_deps.sort! + assert_equal expected_deps, deps.map { |dep| dep.name } + + if Gem.loaded_specs.has_key? 'gemcutter' dep = deps.shift assert_equal 'gemcutter', dep.name assert_equal :development, dep.type version = Gem.loaded_specs['gemcutter'].version assert_equal ">= #{version}", dep.version_requirements.to_s + end dep = deps.shift assert_equal 'hoe', dep.name assert_equal :development, dep.type assert_equal ">= #{Hoe::VERSION}", dep.version_requirements.to_s + if Gem.loaded_specs.has_key? 'rubyforge' dep = deps.shift assert_equal 'rubyforge', dep.name assert_equal :development, dep.type assert_equal ">= #{::RubyForge::VERSION}", dep.version_requirements.to_s + end end def test_plugins