mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Add initial tests that run Jim's "checks"
This commit is contained in:
26
tests/check_test.rb
Normal file
26
tests/check_test.rb
Normal 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
|
||||
Reference in New Issue
Block a user