Skip to content

Commit

Permalink
Merge pull request #2 from cheshire137/tests
Browse files Browse the repository at this point in the history
Add test framework
  • Loading branch information
cheshire137 authored Nov 25, 2024
2 parents 2421e56 + 6cdf109 commit 5f7052d
Show file tree
Hide file tree
Showing 8 changed files with 1,593 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@ name: Run tests

on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**.rb"
- Gemfile
- Gemfile.lock
- .github/workflows/run_tests.yml

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
run-tests:
runs-on: ubuntu-latest
Expand All @@ -24,3 +36,6 @@ jobs:

- name: Check types
run: bundle exec srb tc

- name: Run tests
run: bundle exec rake test
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

source 'https://rubygems.org'

gem 'rake', '~> 13.2.1', group: [:development, :test]
gem 'sorbet', '~> 0.5.11663', group: :development
gem 'sorbet-runtime', '~> 0.5.11663'
gem 'tapioca', '~> 0.16.4', require: false, group: [:development, :test]
gem 'minitest', '~> 5.25', '>= 5.25.1', group: :test
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ GEM
remote: https://rubygems.org/
specs:
erubi (1.13.0)
minitest (5.25.2)
netrc (0.11.0)
parallel (1.26.3)
prism (1.2.0)
rake (13.2.1)
rbi (0.2.1)
prism (~> 1.0)
sorbet-runtime (>= 0.5.9204)
Expand Down Expand Up @@ -43,6 +45,8 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
minitest (~> 5.25, >= 5.25.1)
rake (~> 13.2.1)
sorbet (~> 0.5.11663)
sorbet-runtime (~> 0.5.11663)
tapioca (~> 0.16.4)
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,19 @@ bundle install
Check types:

```sh
srb tc
bundle exec srb tc
```

Run tests:

```sh
bundle exec rake test
```

Run a single test file with a command like `ruby -Ilib:test PATH_TO_TEST`, for example:

```sh
ruby -Ilib:test test/lib/project_pull_mover/utils_test.rb
```

### Creating a tag
Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require "minitest/test_task"

Minitest::TestTask.create(:test)
Loading

0 comments on commit 5f7052d

Please sign in to comment.