File tree 4 files changed +55
-0
lines changed
4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+ on : [push]
3
+ jobs :
4
+ test :
5
+ runs-on : ubuntu-latest
6
+ steps :
7
+ - name : Checkout code
8
+ uses : actions/checkout@v3
9
+
10
+ - name : Install Ruby!
11
+ uses : ruby/setup-ruby@v1
12
+ with :
13
+ ruby-version : " 3.2.2"
14
+
15
+ - name : run tests
16
+ run : rake test
Original file line number Diff line number Diff line change
1
+ require 'rake/testtask'
2
+
3
+ Rake ::TestTask . new do |t |
4
+ t . libs << "tests"
5
+ t . test_files = FileList [ "tests/**/*_test.rb" ]
6
+ t . verbose = true
7
+ end
8
+ desc 'Run tests'
9
+
Original file line number Diff line number Diff line change
1
+ require_relative "test_helper"
2
+
3
+ class CheckTest < Minitest ::Test
4
+ def with_captured_stdout
5
+ original_stdout = $stdout
6
+ $stdout = StringIO . new
7
+ yield
8
+ $stdout. string
9
+ ensure
10
+ $stdout = original_stdout
11
+ end
12
+
13
+ def test_check_asserts
14
+ output = with_captured_stdout do
15
+ Rake ::Task [ 'check:asserts' ] . invoke
16
+ end
17
+ assert_match ( /OK/ , output )
18
+ end
19
+
20
+ def test_check_abouts
21
+ output = with_captured_stdout do
22
+ Rake ::Task [ 'check:abouts' ] . invoke
23
+ end
24
+ assert_match ( /OK/ , output )
25
+ end
26
+ end
Original file line number Diff line number Diff line change
1
+ require "minitest/autorun"
2
+ require "rake"
3
+
4
+ Rake . application . load_rakefile
You can’t perform that action at this time.
0 commit comments