Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Instead of relying on "puts nil" producing output, output a fixed str…

…ing.

This fixes tests run on Ruby 1.9 as "puts nil" produces no output there.
  • Loading branch information...
commit 0756fb4746ff29edbebf4872956816f41ac3824f 1 parent 267f138
Diego Elio Pettenò authored January 12, 2010

Showing 1 changed file with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. 14  test/loader_test.rb
14  test/loader_test.rb
@@ -26,8 +26,8 @@ def capture_output(code = "")
26 26
       end
27 27
 
28 28
       should "not load HTTPClient" do
29  
-        output = capture_output "puts defined?(HTTPClient)"
30  
-        assert_equal "nil", output.strip
  29
+        output = capture_output "puts 'good' unless defined?(HTTPClient)"
  30
+        assert_equal "good", output.strip
31 31
       end
32 32
     end
33 33
 
@@ -40,8 +40,8 @@ def capture_output(code = "")
40 40
       end
41 41
 
42 42
       should "not load HTTPClient" do
43  
-        output = capture_output "puts defined?(HTTPClient)"
44  
-        assert_match "nil", output.strip
  43
+        output = capture_output "puts 'good' unless defined?(HTTPClient)"
  44
+        assert_match "good", output.strip
45 45
       end
46 46
     end
47 47
 
@@ -54,10 +54,10 @@ def capture_output(code = "")
54 54
       end
55 55
 
56 56
       should "not load Net::HTTP" do
57  
-        output = capture_output "puts defined?(Net::HTTP)"
58  
-        assert_match "nil", output.strip
  57
+        output = capture_output "puts 'good' unless defined?(Net::HTTP)"
  58
+        assert_match "good", output.strip
59 59
       end
60 60
     end
61 61
   end
62 62
 
63  
-end
  63
+end

0 notes on commit 0756fb4

Please sign in to comment.
Something went wrong with that request. Please try again.