Skip to content

Commit

Permalink
avoid rubocop complaining about duplicate set elements for hash tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radhermit committed Nov 17, 2024
1 parent 6c533cb commit a2fadbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/repo/test_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/repo/test_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/test_eapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2fadbe

Please sign in to comment.