From a0b36f6213a0e163830b4cba531190c6121b783d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 26 May 2026 12:30:19 +0200 Subject: [PATCH 1/2] Use ParameterMatchers::BaseMethods from Mocha 2.8+ --- Gemfile | 2 +- lib/hammer_cli_foreman/testing/api_expectations.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index db59552d2..9978313f6 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ group :test do gem 'thor' gem 'minitest', '~> 5.18' gem 'simplecov' - gem 'mocha', "~> 2.1.0" + gem 'mocha', "~> 2.8" gem 'ci_reporter_minitest', "~> 1.0.0", :require => false end diff --git a/lib/hammer_cli_foreman/testing/api_expectations.rb b/lib/hammer_cli_foreman/testing/api_expectations.rb index 43b25ea0e..5f7dded39 100644 --- a/lib/hammer_cli_foreman/testing/api_expectations.rb +++ b/lib/hammer_cli_foreman/testing/api_expectations.rb @@ -6,7 +6,9 @@ def self.api_calls @api_calls ||= [] end - class APICallMatcher < Mocha::ParameterMatchers::Base + class APICallMatcher + include Mocha::ParameterMatchers::BaseMethods + attr_accessor :expected_params, :expected_resource, :expected_action, :block def initialize(resource=nil, action=nil, &block) From 97ebb425494ebe33a8455b52ea1f117f84c645c0 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 27 May 2026 08:42:54 +0200 Subject: [PATCH 2/2] Allow Mocha 3.x --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9978313f6..96d56bec6 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ group :test do gem 'thor' gem 'minitest', '~> 5.18' gem 'simplecov' - gem 'mocha', "~> 2.8" + gem 'mocha', '>= 2.8', '< 4' gem 'ci_reporter_minitest', "~> 1.0.0", :require => false end