diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 9c44d9a..e82d395 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -2,9 +2,9 @@ name: RuboCop on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read @@ -19,15 +19,15 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ruby-version: ['3.3'] + ruby-version: ["3.1"] steps: - - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true - rubygems: latest - - name: Ruby linter - run: bundle exec bin/rubocop + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + rubygems: latest + - name: Ruby linter + run: bundle exec bin/rubocop diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48adea8..0e3494d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read @@ -15,22 +15,22 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.0', '3.1', '3.2', '3.3'] - channel: ['stable'] + ruby-version: ["3.1", "3.2", "3.3"] + channel: ["stable"] include: - - ruby-version: 'head' - channel: 'experimental' + - ruby-version: "head" + channel: "experimental" continue-on-error: ${{ matrix.channel != 'stable' }} steps: - - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true - rubygems: latest - - name: Run specs - run: bundle exec rake + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + rubygems: latest + - name: Run specs + run: bundle exec rake diff --git a/.rubocop.yml b/.rubocop.yml index 533c61c..5b7d757 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,12 +6,16 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 DisplayStyleGuide: true ExtraDetails: true Exclude: - - 'bin/**/*' - - 'vendor/bundle/**/*' + - .git/**/* + - .github/**/* + - bin/**/* + - coverage/**/* + - doc/**/* + - vendor/**/* RSpec/ExampleLength: Max: 10 diff --git a/.ruby-version b/.ruby-version index a0891f5..9c25013 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.3.6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 62e0b12..c49e4cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Pundit Matchers +# 4.0.0 (2024-12-18) + +- Drop Ruby < 3.1 compatibility. Please upgrade your Rails application to use + Ruby 3.1 or higher. + ## 3.1.2 (2023-06-28) - Fix namespace resolution under some circumstances diff --git a/Dockerfile b/Dockerfile index 9b66785..6c86d5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1.2 +FROM ruby:3.3.6 LABEL maintainer="chris@chrisalley.info" diff --git a/Gemfile.lock b/Gemfile.lock index 460345d..d77d38c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - pundit-matchers (3.1.2) + pundit-matchers (4.0.0) rspec-core (~> 3.12) rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) diff --git a/README.md b/README.md index 285ddd3..7d3bdbc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ group: ```ruby group :test do - gem 'pundit-matchers', '~> 3.1' + gem 'pundit-matchers', '~> 4.0' end ``` @@ -26,7 +26,7 @@ And then execute the following command: Pundit Matchers expects that the application you're testing is using a software stack consisting of: -- Ruby 3+ +- Ruby 3.1+ - Pundit 2+ - RSpec 3.12+ diff --git a/pundit-matchers.gemspec b/pundit-matchers.gemspec index 16681d5..3bce5ad 100644 --- a/pundit-matchers.gemspec +++ b/pundit-matchers.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'pundit-matchers' - s.version = '3.1.2' + s.version = '4.0.0' s.summary = 'RSpec matchers for Pundit policies' s.description = 'A set of RSpec matchers for testing Pundit authorisation ' \ 'policies' @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/pundit-community/pundit-matchers' s.license = 'MIT' s.metadata['rubygems_mfa_required'] = 'true' - s.required_ruby_version = '>= 3.0' + s.required_ruby_version = '>= 3.1' %w[core expectations mocks support].each do |name| s.add_dependency "rspec-#{name}", '~> 3.12' diff --git a/spec/policy_factory.rb b/spec/policy_factory.rb index 3bebeba..cc2cd54 100644 --- a/spec/policy_factory.rb +++ b/spec/policy_factory.rb @@ -15,7 +15,7 @@ def user end class DynamicTestPolicy < TestPolicy - def method_missing(method, *args, &block) + def method_missing(method, *args, &) method_s = method.to_s return super unless method_s.end_with?('?')