From a2fadbe83ebe3431354e36fedcb11c4b20bd3b51 Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Sun, 17 Nov 2024 09:12:09 -0700 Subject: [PATCH] avoid rubocop complaining about duplicate set elements for hash tests --- test/repo/test_base.rb | 3 ++- test/repo/test_set.rb | 3 ++- test/test_eapi.rb | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/repo/test_base.rb b/test/repo/test_base.rb index 6b9b9d2..a7978eb 100644 --- a/test/repo/test_base.rb +++ b/test/repo/test_base.rb @@ -116,7 +116,8 @@ def test_hash r2 = temp2.repo # equal - repos = Set.new([r1, r1]) + repos = [r1, r1] + repos = Set.new(repos) assert_equal(1, repos.length) # unequal diff --git a/test/repo/test_set.rb b/test/repo/test_set.rb index 0a481ef..9284ba7 100644 --- a/test/repo/test_set.rb +++ b/test/repo/test_set.rb @@ -58,7 +58,8 @@ def test_hash s1 = RepoSet.new s2 = RepoSet.new s3 = RepoSet.new(Fake.new) - assert_equal(1, Set[s1, s1].length) + repos = [s1, s1] + assert_equal(1, Set.new(repos).length) assert_equal(1, Set[s1, s2].length) assert_equal(2, Set[s1, s3].length) end diff --git a/test/test_eapi.rb b/test/test_eapi.rb index 01c606c..773f505 100644 --- a/test/test_eapi.rb +++ b/test/test_eapi.rb @@ -75,7 +75,8 @@ def test_cmp def test_hash # equal - eapis = Set.new([EAPI8, EAPI8]) + eapis = [EAPI8, EAPI8] + eapis = Set.new(eapis) assert_equal(1, eapis.length) # unequal