From 555ac4625c404e4cfe0fe1e3e1c84693265cbbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 3 Aug 2023 17:28:25 +0200 Subject: [PATCH] Mocha 2.0+ / Minitest 5.19+ compatibility (#266) * Mocha 2.0+ compatibility The support for `require 'mocha/setup'` is long time deprecated and was removed in Mocha 2.0: https://github.com/freerange/mocha/commit/642a0ff4 * Fix compatibility with Minitest 5.19+ The `MiniTest` was renamed to `Minitest`: https://github.com/minitest/minitest/commit/9a57c520ceac76abfe6105866f8548a94eb357b6 And the `MiniTest` constant is now loaded just when `MT_COMPAT` environment variable is set: https://github.com/minitest/minitest/commit/a2c6c18570f6f0a1bf6af70fe3b6d9599a13fdd6 --- test/unit/cors_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/cors_test.rb b/test/unit/cors_test.rb index 5360613..00d6431 100644 --- a/test/unit/cors_test.rb +++ b/test/unit/cors_test.rb @@ -4,7 +4,7 @@ require 'rack/lint' require 'minitest/autorun' require 'rack/test' -require 'mocha/setup' +require 'mocha/minitest' require 'rack/cors' require 'ostruct' @@ -21,7 +21,7 @@ def options(uri, params = {}, env = {}, &block) def_delegator :current_session, :options end -module MiniTest::Assertions +module Minitest::Assertions def assert_cors_success(response) assert !response.headers['Access-Control-Allow-Origin'].nil?, 'Expected a successful CORS response' end