Skip to content

Commit

Permalink
Mocha 2.0+ / Minitest 5.19+ compatibility (#266)
Browse files Browse the repository at this point in the history
* Mocha 2.0+ compatibility

The support for `require 'mocha/setup'` is long time deprecated and was
removed in Mocha 2.0:

freerange/mocha@642a0ff4

* Fix compatibility with Minitest 5.19+

The `MiniTest` was renamed to `Minitest`:

minitest/minitest@9a57c52

And the `MiniTest` constant is now loaded just when `MT_COMPAT`
environment variable is set:

minitest/minitest@a2c6c18
  • Loading branch information
voxik committed Aug 3, 2023
1 parent 202b85d commit 555ac46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit/cors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'rack/lint'
require 'minitest/autorun'
require 'rack/test'
require 'mocha/setup'
require 'mocha/minitest'
require 'rack/cors'
require 'ostruct'

Expand All @@ -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
Expand Down

0 comments on commit 555ac46

Please sign in to comment.