Skip to content

Commit

Permalink
Merge pull request #1 from CoderMiguel/CoderMiguel-Set-smove
Browse files Browse the repository at this point in the history
Add smove test coverage
  • Loading branch information
CoderMiguel authored Jan 24, 2025
2 parents 8850def + 7fcb2ae commit 3cc5bea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/types/set_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ class SetTest < ActiveSupport::TestCase
assert_equal [ 1.5, 2.7 ], @set.sample(2).sort
end

test "smove" do
@set.add(%w[ 1 2 ])
another_set = Kredis.set "another_set"
another_set.add(%w[ 3 ])

assert @set.smove(another_set.key, "2")
assert_equal %w[ 1 ], @set.members
assert_equal %w[ 2 3 ], another_set.members
end

test "default" do
@set = Kredis.set "mylist", default: %w[ 1 2 3 ]
Expand Down

0 comments on commit 3cc5bea

Please sign in to comment.