From 65dda17d3332b527f8f35b6e36e415adaa5ad876 Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Mon, 8 Feb 2021 10:37:23 -0500 Subject: [PATCH] Remove RSpec hack This is no longer needed as of [rspec-mocks 3.10.2](https://github.com/rspec/rspec-mocks/blob/main/Changelog.md#3102--2021-01-27) --- .../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 aabb1e3a..74afbdfd 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.replica_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 c87210f9..c1d6b1dc 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