From b2d6a1f3d6a98b06b8a1b0c8166f4681eebf0b72 Mon Sep 17 00:00:00 2001 From: Uwe Kubosch Date: Sun, 9 Jun 2024 17:19:59 +0200 Subject: [PATCH] Add support for Rails 7.1 and Ruby 3.3 and 3.2 --- .github/workflows/test.yml | 2 +- test/middleware_test.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e77da60..f265f04 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: ruby-version: '3.3' bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Rubocop - run: bundle exec rubocop --auto-correct-all + run: bundle exec rubocop --autocorrect-all Test: runs-on: ubuntu-20.04 services: diff --git a/test/middleware_test.rb b/test/middleware_test.rb index d2576e9..8420d2c 100644 --- a/test/middleware_test.rb +++ b/test/middleware_test.rb @@ -20,10 +20,10 @@ def setup def test_get_without_detour env = env_for('/') - status, headers, response = @stack.call env + status, headers, body = @stack.call env assert_equal 200, status - assert_equal ['app response'], [*response] + assert_equal ['app response'], [*body] assert_equal [], headers['rack.session'].to_hash.keys assert_nil headers['rack.session'].to_hash['detours'] end @@ -34,7 +34,7 @@ def test_detour status, headers, body = @stack.call(env) assert_equal 200, status - assert_equal ['app response'], body + assert_equal ['app response'], [*body] assert_equal(%w[session_id detours], headers['rack.session'].to_hash.keys) assert_equal([{ 'controller' => 'test' }], headers['rack.session'].to_hash['detours']) end @@ -50,10 +50,10 @@ def test_detour_cleanup last_env = env_for('/?detour[controller]=test_last', 'rack.session' => env['rack.session'], 'rack.session.options' => env['rack.session.options']) - status, env, response = @stack.call last_env + status, env, body = @stack.call last_env assert_equal 200, status - assert_equal ['app response'], [*response] + assert_equal ['app response'], [*body] assert_equal(%w[session_id detours], env['rack.session'].to_hash.keys) assert_equal(((57..99).to_a + [:last]).map { |i| { 'controller' => "test_#{i}" } },