From 642a0ff4f3806ae0a625c50c14a6a39702735e51 Mon Sep 17 00:00:00 2001 From: James Mead Date: Sat, 15 Oct 2022 18:21:59 +0100 Subject: [PATCH] Remove deprecated mocha/setup.rb mechanism Previously this was the recommended way to integrate Mocha with a test framework. However, this mechanism was deprecated in #399 in favour of requiring a file specific to the relevant test framework, i.e. mocha/test_unit.rb or mocha/minitest.rb. Test frameworks like RSpec integrate by requiring mocha/api.rb. This old mechanism was deprecated in v1.10.0 [1,2] and so is safe to remove now. [1]: 36adf880a0b9302fb5e770161c2e962e7e20fe71 [2]: 388f44d778c2239b52ffe5c52ace253419f91bd3 --- lib/mocha/integration.rb | 11 ----------- lib/mocha/setup.rb | 14 -------------- 2 files changed, 25 deletions(-) delete mode 100644 lib/mocha/integration.rb delete mode 100644 lib/mocha/setup.rb diff --git a/lib/mocha/integration.rb b/lib/mocha/integration.rb deleted file mode 100644 index 58e23e7c9..000000000 --- a/lib/mocha/integration.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'mocha/integration/test_unit' -require 'mocha/integration/mini_test' - -module Mocha - module Integration - def self.activate - return unless [Integration::TestUnit, Integration::MiniTest].map(&:activate).none? - raise "Test::Unit or Minitest must be loaded *before* `require 'mocha/setup'`." - end - end -end diff --git a/lib/mocha/setup.rb b/lib/mocha/setup.rb deleted file mode 100644 index 0c1c1f861..000000000 --- a/lib/mocha/setup.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'mocha/integration' -require 'mocha/deprecation' - -Mocha::Deprecation.warning( - "Require 'mocha/test_unit', 'mocha/minitest' or 'mocha/api' instead of 'mocha/setup'." -) - -module Mocha - def self.activate - Integration.activate - end -end - -Mocha.activate