Skip to content

Commit 06ed265

Browse files
committed
Ensure parity in tests for reporters
1 parent 8f12d8c commit 06ed265

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

test/fixtures/test_unit_example.rb

+6
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@ def test_that_is_pending
2121
def test_that_raises
2222
raise "oops"
2323
end
24+
25+
def test_with_output
26+
$stdout.puts "hello from $stdout.puts\nanother line"
27+
puts "hello from puts\nanother line"
28+
$stdout.write "hello from write\nanother line"
29+
end
2430
end

test/test_unit_test_runner_test.rb

+33
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,40 @@ def test_test_runner_output
8080
"uri" => uri,
8181
},
8282
},
83+
{
84+
"method" => "start",
85+
"params" => {
86+
"id" => "SampleTest#test_with_output",
87+
"uri" => uri,
88+
},
89+
},
90+
{
91+
"method" => "append_output",
92+
"params" => {
93+
"message" => "hello from $stdout.puts\r\nanother line\r\n",
94+
},
95+
},
96+
{
97+
"method" => "append_output",
98+
"params" => {
99+
"message" => "hello from puts\r\nanother line\r\n",
100+
},
101+
},
102+
{
103+
"method" => "append_output",
104+
"params" => {
105+
"message" => "hello from write\r\nanother line",
106+
},
107+
},
108+
{
109+
"method" => "pass",
110+
"params" => {
111+
"id" => "SampleTest#test_with_output",
112+
"uri" => uri,
113+
},
114+
},
83115
]
116+
assert_equal(2 + 2 + 2 + 2 + 5, actual.size)
84117
assert_equal(expected, actual)
85118
end
86119
end

0 commit comments

Comments
 (0)