Skip to content

Commit

Permalink
Add initial tests that run Jim's "checks"
Browse files Browse the repository at this point in the history
  • Loading branch information
tonywok committed Aug 15, 2023
1 parent 104b7f6 commit d08ceb0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
with:
ruby-version: "3.2.2"

- name: rake check
run: rake check
- name: run tests
run: ruby tests/**/*_test.rb
26 changes: 26 additions & 0 deletions tests/check_test.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require "minitest/autorun"
require "rake"

Rake.application.load_rakefile

0 comments on commit d08ceb0

Please sign in to comment.