File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,26 @@ class SetTest < ActiveSupport::TestCase
110110 assert_equal %w[ 1 ] , @set . members
111111 assert_equal %w[ 2 3 ] , another_set . members
112112 end
113+
114+ test "move with set" do
115+ @set . add ( %w[ x y ] )
116+ another_set = Kredis . set "another_set"
117+ another_set . add ( %w[ z ] )
118+
119+ assert @set . move ( another_set , "y" )
120+ assert_equal %w[ x ] , @set . members
121+ assert_equal %w[ y z ] , another_set . members
122+ end
123+
124+ test "move with key" do
125+ @set . add ( %w[ a b ] )
126+ another_set = Kredis . set "another_set"
127+ another_set . add ( %w[ c ] )
128+
129+ assert @set . move ( another_set . key , "b" )
130+ assert_equal %w[ a ] , @set . members
131+ assert_equal %w[ b c ] , another_set . members
132+ end
113133
114134 test "default" do
115135 @set = Kredis . set "mylist" , default : %w[ 1 2 3 ]
You can’t perform that action at this time.
0 commit comments