From 39450d7bb6a818b344875352fd3db3093653d17b Mon Sep 17 00:00:00 2001
From: Matt Larraz <mlarraz@users.noreply.github.com>
Date: Mon, 8 Feb 2021 09:23:33 -0800
Subject: [PATCH] Remove RSpec hack (#301)

---
 .../connection_adapters/makara_mysql2_adapter_spec.rb         | 4 +---
 .../connection_adapters/makara_postgresql_adapter_spec.rb     | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/spec/active_record/connection_adapters/makara_mysql2_adapter_spec.rb b/spec/active_record/connection_adapters/makara_mysql2_adapter_spec.rb
index 0c11b76c..d8daa164 100644
--- a/spec/active_record/connection_adapters/makara_mysql2_adapter_spec.rb
+++ b/spec/active_record/connection_adapters/makara_mysql2_adapter_spec.rb
@@ -157,9 +157,7 @@
       con = connection.slave_pool.connections.first
       expect(con).to receive(:exec_query) do |query|
         expect(query).to match(/SELECT\s+1\s*(AS one)?\s+FROM .?users.?\s+LIMIT\s+.?1/)
-      end.once.
-        # and_call_original # Switch back to this once https://github.com/rspec/rspec-mocks/pull/1385 is released
-        and_wrap_original { |m, *args| m.call(*args.first(3)) }
+      end.once.and_call_original
 
       Test::User.exists?
     end
diff --git a/spec/active_record/connection_adapters/makara_postgresql_adapter_spec.rb b/spec/active_record/connection_adapters/makara_postgresql_adapter_spec.rb
index 897f5b88..e4b7f67d 100644
--- a/spec/active_record/connection_adapters/makara_postgresql_adapter_spec.rb
+++ b/spec/active_record/connection_adapters/makara_postgresql_adapter_spec.rb
@@ -73,9 +73,7 @@
 
       expect(con).to receive(:exec_query) do |query|
         expect(query).to match(/SELECT\s+1\s*(AS one)?\s+FROM .?users.?\s+LIMIT\s+.?1/)
-      end.once.
-        # and_call_original # Switch back to this once https://github.com/rspec/rspec-mocks/pull/1385 is released
-        and_wrap_original { |m, *args| m.call(*args.first(3)) }
+      end.once.and_call_original
 
       Test::User.exists?
     end