# תמיכה ב-Ruby 3 הקשורה ל-gem mocha

**URL:** <https://meta.discourse.org/t/ruby-3-support-related-to-mocha-gem/205409>\
**Category:** Development\
**Created:** [7 באוקטובר,‏ 2021,‏ 3:41am UTC](https://meta.discourse.org/t/ruby-3-support-related-to-mocha-gem/205409 "2021-10-07T03:41:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![yahonda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yahonda/32/234118_2.png) [@yahonda](https://meta.discourse.org/u/yahonda)\
**Post date:** [12 באוקטובר,‏ 2021,‏ 11:55am UTC](https://meta.discourse.org/t/ruby-3-support-related-to-mocha-gem/205409/4 "2021-10-12T11:55:02Z")

</div>

I’ve found a similar issue reported and a workaround is explained  
[https://github.com/freerange/mocha/issues/445#issuecomment-644944003](https://github.com/freerange/mocha/issues/445#issuecomment-644944003)

> use kwargs vs \*\*kwargs, then kwargs will be a Hash which you can use in your assertion and no warnings will be generated…

Applying the workaround suggested makes failing specs green.

[https://github.com/yahonda/discourse/commit/356f15b02cb4a0bb869d19adf2a2018d07ee79bf](https://github.com/yahonda/discourse/commit/356f15b02cb4a0bb869d19adf2a2018d07ee79bf)

```diff
$ git diff main
diff --git a/spec/lib/backup_restore/shared_context_for_backup_restore.rb b/spec/lib/backup_restore/shared_context_for_backup_restore.rb
index 2ff78176ea..0fbc8ade15 100644
--- a/spec/lib/backup_restore/shared_context_for_backup_restore.rb
+++ b/spec/lib/backup_restore/shared_context_for_backup_restore.rb
@@ -33,7 +33,7 @@ shared_context "shared stuff" do
   end

   def expect_db_migrate
- Discourse::Utils.expects(:execute_command).with do |env, *command, **options|
+ Discourse::Utils.expects(:execute_command).with do |env, *command, options|
       env["SKIP_POST_DEPLOYMENT_MIGRATIONS"] == "0" &&
         env["SKIP_OPTIMIZE_ICONS"] == "1" &&
         env["DISABLE_TRANSLATION_OVERRIDES"] == "1" &&
$

```

I am happy to open a pull request.

---

_[View the full topic](https://meta.discourse.org/t/ruby-3-support-related-to-mocha-gem/205409)._
