summaryrefslogtreecommitdiff
path: root/test/rake/test_trace_output.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/test_trace_output.rb')
-rw-r--r--test/rake/test_trace_output.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/rake/test_trace_output.rb b/test/rake/test_trace_output.rb
index 750ea14..f9aead9 100644
--- a/test/rake/test_trace_output.rb
+++ b/test/rake/test_trace_output.rb
@@ -6,10 +6,12 @@ class TestTraceOutput < Rake::TestCase
class PrintSpy
attr_reader :result, :calls
+
def initialize
@result = ""
@calls = 0
end
+
def print(string)
@result << string
@calls += 1
@@ -30,6 +32,13 @@ class TestTraceOutput < Rake::TestCase
assert_equal 1, spy.calls
end
+ def test_trace_handles_nil_objects
+ spy = PrintSpy.new
+ trace_on(spy, "HI\n", nil, "LO")
+ assert_equal "HI\nLO\n", spy.result
+ assert_equal 1, spy.calls
+ end
+
def test_trace_issues_single_io_for_args_multiple_strings_and_alternate_sep
old_sep = $\
$\ = "\r"