Skip to content

Commit b7592c4

Browse files
committed
Initial test structure.
1 parent 18b6bc1 commit b7592c4

File tree

6 files changed

+59
-16
lines changed

6 files changed

+59
-16
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6-
build:
7-
8-
runs-on: ubuntu-latest
9-
6+
test:
107
strategy:
8+
fail-fast: false
119
matrix:
12-
node-version: [18.x]
10+
os: [ubuntu-24.04]
11+
ruby: [3.4.4]
12+
13+
runs-on: ${{ matrix.os }}
1314

1415
steps:
15-
- uses: actions/checkout@v3
16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: ${{ matrix.node-version }}
20-
cache: 'npm'
21-
- run: npm install
22-
- run: npm run build --if-present
23-
- run: npm test
16+
- uses: actions/checkout@v2
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 23
21+
cache: "npm"
22+
- run: npm ci
23+
24+
- name: Set up Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: ${{ matrix.ruby }}
28+
bundler-cache: true
29+
30+
- name: Run tests
31+
run: bundle exec rake

Gemfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ gem "sd_notify"
66
gem "unicorn"
77
gem "sinatra"
88
gem "connection_pool"
9-
gem "http"
9+
gem "http"
10+
11+
group :test do
12+
gem "minitest"
13+
gem "webmock"
14+
end

Gemfile.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ GEM
44
addressable (2.8.7)
55
public_suffix (>= 2.0.2, < 7.0)
66
base64 (0.3.0)
7+
bigdecimal (3.2.2)
78
connection_pool (2.5.3)
9+
crack (1.0.0)
10+
bigdecimal
11+
rexml
812
domain_name (0.6.20240107)
913
ffi (1.17.2)
14+
ffi (1.17.2-arm64-darwin)
1015
ffi-compiler (1.3.2)
1116
ffi (>= 1.15.5)
1217
rake
18+
hashdiff (1.2.0)
1319
http (5.3.1)
1420
addressable (~> 2.8)
1521
http-cookie (~> 1.0)
@@ -23,6 +29,7 @@ GEM
2329
ffi-compiler (~> 1.0)
2430
rake (~> 13.0)
2531
logger (1.7.0)
32+
minitest (5.25.5)
2633
mustermann (3.0.3)
2734
ruby2_keywords (~> 0.0.1)
2835
nio4r (2.7.4)
@@ -39,6 +46,7 @@ GEM
3946
rack (>= 3.0.0)
4047
raindrops (0.20.1)
4148
rake (13.3.0)
49+
rexml (3.4.1)
4250
ruby2_keywords (0.0.5)
4351
sd_notify (0.1.1)
4452
sinatra (4.1.1)
@@ -52,17 +60,23 @@ GEM
5260
unicorn (6.1.0)
5361
kgio (~> 2.6)
5462
raindrops (~> 0.7)
63+
webmock (3.25.1)
64+
addressable (>= 2.8.0)
65+
crack (>= 0.3.2)
66+
hashdiff (>= 0.4.0, < 2.0.0)
5567

5668
PLATFORMS
57-
ruby
69+
arm64-darwin-24
5870

5971
DEPENDENCIES
6072
connection_pool
6173
http
74+
minitest
6275
puma
6376
sd_notify
6477
sinatra
6578
unicorn
79+
webmock
6680

6781
BUNDLED WITH
6882
2.6.7

Rakefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require "rake/testtask"
2+
3+
Rake::TestTask.new(:test) do |t|
4+
t.libs << "_test"
5+
t.test_files = FileList["test/**/*_test.rb"]
6+
t.warning = false
7+
end
8+
9+
task default: :test

test/app_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require_relative "test_helper"
2+
3+
class AppTest < Minitest::Test
4+
end

test/test_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require "minitest/autorun"
2+
require "webmock/minitest"
3+
require_relative "../app/app.rb"

0 commit comments

Comments
 (0)