From 68efb8adfebb262084ba882073ed8a1507537603 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Tue, 8 Aug 2023 08:48:34 -0700 Subject: [PATCH] Upgrade mocha to fix test failures against minitest 5.19 (#147) This fixes the following test failure: > gems/mocha-1.16.1/lib/mocha/integration/mini_test/adapter.rb:26:in 'included': uninitialized constant MiniTest (NameError) Did you mean? Minitest --- Gemfile | 1 + airbrussh.gemspec | 2 +- test/support/mocha.rb | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6429e6a..e99465d 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ if RUBY_VERSION == "1.9.3" # These gems need specific version for Ruby 1.9 gem "json", "~> 1.8" gem "minitest", "~> 5.11.3" + gem "mocha", "~> 1.2" gem "net-ssh", "~> 2.8" gem "rake", "< 12.3" gem "term-ansicolor", "~> 1.3.2" diff --git a/airbrussh.gemspec b/airbrussh.gemspec index 69ea9e9..c42b84f 100644 --- a/airbrussh.gemspec +++ b/airbrussh.gemspec @@ -33,5 +33,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "minitest", "~> 5.10" spec.add_development_dependency "minitest-reporters", "~> 1.1" - spec.add_development_dependency "mocha", "~> 1.2" + spec.add_development_dependency "mocha", "~> 2.1" end diff --git a/test/support/mocha.rb b/test/support/mocha.rb index fed5b3c..7c006e2 100644 --- a/test/support/mocha.rb +++ b/test/support/mocha.rb @@ -1,4 +1,6 @@ require "mocha/minitest" -Mocha::Configuration.warn_when(:stubbing_non_existent_method) -Mocha::Configuration.warn_when(:stubbing_non_public_method) +Mocha.configure do |c| + c.stubbing_non_existent_method = :warn + c.stubbing_non_public_method = :warn +end