Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure parity between test-unit and minitest examples #3328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/fixtures/test_unit_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ def test_that_is_pending
def test_that_raises
raise "oops"
end

def test_with_output
$stdout.puts "hello from $stdout.puts\nanother line"
puts "hello from puts\nanother line"
$stdout.write "hello from write\nanother line"
end
end
33 changes: 33 additions & 0 deletions test/test_unit_test_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,40 @@ def test_test_runner_output
"uri" => uri,
},
},
{
"method" => "start",
"params" => {
"id" => "SampleTest#test_with_output",
"uri" => uri,
},
},
{
"method" => "append_output",
"params" => {
"message" => "hello from $stdout.puts\r\nanother line\r\n",
},
},
{
"method" => "append_output",
"params" => {
"message" => "hello from puts\r\nanother line\r\n",
},
},
{
"method" => "append_output",
"params" => {
"message" => "hello from write\r\nanother line",
},
},
{
"method" => "pass",
"params" => {
"id" => "SampleTest#test_with_output",
"uri" => uri,
},
},
]
assert_equal(2 + 2 + 2 + 2 + 5, actual.size)
assert_equal(expected, actual)
end
end
Expand Down
Loading