diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2013-01-14 16:01:54 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2013-01-14 16:01:54 +0000 |
commit | 20448615c4398ae4888a376012afd5e96e4a4974 (patch) | |
tree | 2ab0feb509b4c205e398f17f8b52c8c0b8fa6648 /test | |
parent | d9a27ae12fb2c06af1ca34cd3c166501ab991355 (diff) | |
download | slop-20448615c4398ae4888a376012afd5e96e4a4974.tar.gz |
use temp_stdout instead of temp_stderr for redirecting help output
Diffstat (limited to 'test')
-rw-r--r-- | test/slop_test.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index 81d9a2a..6be811e 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -16,11 +16,11 @@ class SlopTest < TestCase ARGV.replace old_argv end - def temp_stderr - $stderr = StringIO.new - yield $stderr.string + def temp_stdout + $stdout = StringIO.new + yield $stdout.string ensure - $stderr = STDERR + $stdout = STDOUT end test "includes Enumerable" do @@ -330,13 +330,13 @@ class SlopTest < TestCase end test "printing help with :help => true" do - temp_stderr do |string| + temp_stdout do |string| opts = Slop.new(:help => true, :banner => false) opts.parse %w( --help ) assert_equal " -h, --help Display this help message.\n", string end - temp_stderr do |string| + temp_stdout do |string| opts = Slop.new(:help => true) opts.parse %w( --help ) assert_equal "Usage: rake_test_loader [options]\n -h, --help Display this help message.\n", string |