From 917bcb73f5a6c1c0f29fbf510345c5d8e4a1f490 Mon Sep 17 00:00:00 2001 From: Wesley Beary Date: Fri, 22 Dec 2023 09:18:33 -0600 Subject: [PATCH] Revert "Delegate methods that accept keywords from Fog::Collection to Array correctly for Ruby 2.x and Ruby 3.x (#292)" (#295) This reverts commit 7c4a8320da5ecad884e4ee32b6baf41de5410ee5. --- lib/fog/core/collection.rb | 2 -- spec/core/collection_spec.rb | 24 ------------------------ 2 files changed, 26 deletions(-) delete mode 100644 spec/core/collection_spec.rb diff --git a/lib/fog/core/collection.rb b/lib/fog/core/collection.rb index b2799c4..7441958 100644 --- a/lib/fog/core/collection.rb +++ b/lib/fog/core/collection.rb @@ -19,7 +19,6 @@ def #{method}(*args) end super end - ruby2_keywords(method) if respond_to?(:ruby2_keywords, true) EOS end @@ -32,7 +31,6 @@ def #{method}(*args) data = super self.clone.clear.concat(data) end - ruby2_keywords(method) if respond_to?(:ruby2_keywords, true) EOS end diff --git a/spec/core/collection_spec.rb b/spec/core/collection_spec.rb deleted file mode 100644 index acea928..0000000 --- a/spec/core/collection_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require "spec_helper" -require "securerandom" - -class FogTestModelForCollection < Fog::Model - identity :id -end - -class FogTestCollection < Fog::Collection - model FogTestModelForCollection - - def all - self - end -end - -describe Fog::Collection do - describe "array delegation" do - it "delegates methods with keywords to Array" do - c = FogTestCollection.new - c << FogTestModelForCollection.new(id: SecureRandom.hex) - assert_equal c.sample(1, random: Random)[0], c[0] - end - end -end