diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..0c43a67 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,27 @@ +name: Ruby + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ["3.0", "3.1", "3.2", "3.3"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake diff --git a/sluggi.gemspec b/sluggi.gemspec index 9b36d8c..305e978 100644 --- a/sluggi.gemspec +++ b/sluggi.gemspec @@ -15,12 +15,13 @@ Gem::Specification.new do |spec| spec.files = Dir["lib/**/*.rb", "README.md", "LICENSE.txt"] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.3.0" + spec.required_ruby_version = ">= 3.0.0" - spec.add_dependency "activerecord", "~> 5.1" - spec.add_dependency "railties", "~> 5.1" + spec.add_dependency "activerecord", "~> 6.0" + spec.add_dependency "railties", "~> 6.0" spec.add_development_dependency "appraisal", "~> 2.0" - spec.add_development_dependency "rake", "~> 12.0" + spec.add_development_dependency "minitest", "~> 5.22" + spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "sqlite3", "~> 1.3" end diff --git a/test/history_test.rb b/test/history_test.rb index 9c4c8d2..29395ff 100644 --- a/test/history_test.rb +++ b/test/history_test.rb @@ -44,7 +44,7 @@ class BigDog < Dog class LittleDog < Dog end -class HistoryTest < MiniTest::Spec +class HistoryTest < Minitest::Spec before do Cat.delete_all Sluggi::Slug.delete_all diff --git a/test/model_test.rb b/test/model_test.rb index 3934855..6b5499d 100644 --- a/test/model_test.rb +++ b/test/model_test.rb @@ -2,7 +2,7 @@ require "test_helper" -class ModelTest < MiniTest::Spec +class ModelTest < Minitest::Spec class IncompleteCat < ActiveRecord::Base self.table_name = "cats" include Sluggi::Model diff --git a/test/slug_test.rb b/test/slug_test.rb index 99c78db..36b655d 100644 --- a/test/slug_test.rb +++ b/test/slug_test.rb @@ -3,7 +3,7 @@ require "test_helper" module Sluggi - class SlugTest < MiniTest::Spec + class SlugTest < Minitest::Spec describe "validation" do it "is not valid" do slug = Slug.new diff --git a/test/slugged_test.rb b/test/slugged_test.rb index 31b9883..97b7d7c 100644 --- a/test/slugged_test.rb +++ b/test/slugged_test.rb @@ -2,7 +2,7 @@ require "test_helper" -class SluggedTest < MiniTest::Spec +class SluggedTest < Minitest::Spec class Cat < ActiveRecord::Base include Sluggi::Slugged diff --git a/test/validate_presence_test.rb b/test/validate_presence_test.rb index b5ca83b..158af91 100644 --- a/test/validate_presence_test.rb +++ b/test/validate_presence_test.rb @@ -2,7 +2,7 @@ require "test_helper" -class ValidatePresenceTest < MiniTest::Spec +class ValidatePresenceTest < Minitest::Spec class Cat < ActiveRecord::Base include Sluggi::ValidatePresence end diff --git a/test/validate_uniqueness_test.rb b/test/validate_uniqueness_test.rb index c1fc8ad..a840710 100644 --- a/test/validate_uniqueness_test.rb +++ b/test/validate_uniqueness_test.rb @@ -2,7 +2,7 @@ require "test_helper" -class ValidateUniquenessTest < MiniTest::Spec +class ValidateUniquenessTest < Minitest::Spec class Cat < ActiveRecord::Base include Sluggi::Model include Sluggi::ValidateUniqueness diff --git a/test/validates_exclusion_of_test.rb b/test/validates_exclusion_of_test.rb index 9c5042f..5efc69a 100644 --- a/test/validates_exclusion_of_test.rb +++ b/test/validates_exclusion_of_test.rb @@ -2,7 +2,7 @@ require "test_helper" -class ValidatesExclusionOfTest < MiniTest::Spec +class ValidatesExclusionOfTest < Minitest::Spec class Cat < ActiveRecord::Base include Sluggi::ValidateExclusionOf end