mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-13 06:43:20 -04:00
26 lines
522 B
Ruby
26 lines
522 B
Ruby
require_relative "test_helper"
|
|
|
|
class CheckTest < Minitest::Test
|
|
def with_captured_stdout
|
|
original_stdout = $stdout
|
|
$stdout = StringIO.new
|
|
yield
|
|
$stdout.string
|
|
ensure
|
|
$stdout = original_stdout
|
|
end
|
|
|
|
def test_check_asserts
|
|
output = with_captured_stdout do
|
|
Rake::Task['check:asserts'].invoke
|
|
end
|
|
assert_match(/OK/, output)
|
|
end
|
|
|
|
def test_check_abouts
|
|
output = with_captured_stdout do
|
|
Rake::Task['check:abouts'].invoke
|
|
end
|
|
assert_match(/OK/, output)
|
|
end
|
|
end |