Add initial tests that run Jim's "checks"

This commit is contained in:
Tony Schneider
2023-08-15 08:45:00 -04:00
parent 104b7f67b4
commit 9687825fe0
4 changed files with 41 additions and 2 deletions

26
tests/check_test.rb Normal file
View File

@@ -0,0 +1,26 @@
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