Skip to content

Commit 3930212

Browse files
toshimaruclaudechatgpt-codex-connector[bot]
authored
Test setup (#10)
* Add minitest * feat: simple test setup * feat: add GitHub Actions test workflow Add a CI workflow that runs tests on push to main and pull requests, testing against Ruby versions 3.2, 3.3, 3.4, and 4.0. Co-Authored-By: Claude Code <noreply@anthropic.com> * docs: Add GitHub Actions test status badge * Update GitHub Actions dependencies Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
1 parent e68e3c7 commit 3930212

File tree

6 files changed

+54
-4
lines changed

6 files changed

+54
-4
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
ruby-version: ['3.2', '3.3', '3.4', '4.0']
15+
16+
steps:
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
- name: Set up Ruby ${{ matrix.ruby-version }}
19+
uses: ruby/setup-ruby@90be1154f987f4dc0fe0dd0feedac9e473aa4ba8 # v1.286.0
20+
with:
21+
ruby-version: ${{ matrix.ruby-version }}
22+
bundler-cache: true
23+
- name: Run tests
24+
run: bundle exec rake test

Gemfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# frozen_string_literal: true
22

3-
source "https://rubygems.org"
3+
source 'https://rubygems.org'
44

55
# Specify your gem's dependencies in fast_schema_dumper.gemspec
66
gemspec
77

8-
gem "irb"
9-
gem "rake", "~> 13.0"
8+
gem 'irb'
9+
gem 'minitest'
10+
gem 'rake', '~> 13.0'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Test](https://github.com/smartbank-inc/fast_schema_dumper/actions/workflows/test.yml/badge.svg)](https://github.com/smartbank-inc/fast_schema_dumper/actions/workflows/test.yml)
2+
13
# fast_schema_dumper
24

35
A super fast alternative to ActiveRecord::SchemaDumper. Currently only MySQL is supported.

Rakefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# frozen_string_literal: true
22

33
require "bundler/gem_tasks"
4-
task default: %i[]
4+
require "rake/testtask"
5+
6+
Rake::TestTask.new(:test) do |t|
7+
t.libs << "test"
8+
t.libs << "lib"
9+
t.test_files = FileList["test/**/*_test.rb"]
10+
end
11+
12+
task default: :test

test/fast_schema_dumper_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
require "test_helper"
4+
5+
class FastSchemaDumperTest < Minitest::Test
6+
def test_that_it_has_a_version_number
7+
refute_nil ::FastSchemaDumper::VERSION
8+
end
9+
end

test/test_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
4+
require "fast_schema_dumper"
5+
6+
require "minitest/autorun"

0 commit comments

Comments
 (0)