summaryrefslogtreecommitdiff
blob: f13fdc05c874105a931185475b8467500682804e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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