diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4df57da8..fd726588 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,5 +12,5 @@ jobs: with: ruby-version: "3.2.2" - - name: rake check - run: rake check \ No newline at end of file + - name: run tests + run: ruby tests/**/*_test.rb \ No newline at end of file diff --git a/tests/check_test.rb b/tests/check_test.rb new file mode 100644 index 00000000..ba51df26 --- /dev/null +++ b/tests/check_test.rb @@ -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 \ No newline at end of file diff --git a/tests/test_helper.rb b/tests/test_helper.rb new file mode 100644 index 00000000..0abf0b64 --- /dev/null +++ b/tests/test_helper.rb @@ -0,0 +1,4 @@ +require "minitest/autorun" +require "rake" + +Rake.application.load_rakefile \ No newline at end of file