Permalink
Browse files

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...
1 parent 267f138 commit 0756fb4746ff29edbebf4872956816f41ac3824f @Flameeyes Flameeyes committed Jan 12, 2010
Showing with 7 additions and 7 deletions.
  1. +7 −7 test/loader_test.rb
View
@@ -26,8 +26,8 @@ def capture_output(code = "")
end
should "not load HTTPClient" do
- output = capture_output "puts defined?(HTTPClient)"
- assert_equal "nil", output.strip
+ output = capture_output "puts 'good' unless defined?(HTTPClient)"
+ assert_equal "good", output.strip
end
end
@@ -40,8 +40,8 @@ def capture_output(code = "")
end
should "not load HTTPClient" do
- output = capture_output "puts defined?(HTTPClient)"
- assert_match "nil", output.strip
+ output = capture_output "puts 'good' unless defined?(HTTPClient)"
+ assert_match "good", output.strip
end
end
@@ -54,10 +54,10 @@ def capture_output(code = "")
end
should "not load Net::HTTP" do
- output = capture_output "puts defined?(Net::HTTP)"
- assert_match "nil", output.strip
+ output = capture_output "puts 'good' unless defined?(Net::HTTP)"
+ assert_match "good", output.strip
end
end
end
-end
+end

0 comments on commit 0756fb4

Please sign in to comment.