3
3
module Lint
4
4
module Streams
5
5
MIN_REDIS_VERSION = '4.9.0'
6
- MIN_REDIS_VERSION_XAUTOCLAIM = '6.2.0'
7
6
ENTRY_ID_FORMAT = /\d +-\d +/ . freeze
8
7
9
8
def setup
@@ -90,6 +89,16 @@ def test_xadd_with_maxlen_and_approximate_option
90
89
assert_match ENTRY_ID_FORMAT , actual
91
90
end
92
91
92
+ def test_xadd_with_nomkstream_option
93
+ omit_version ( '6.2.0' )
94
+
95
+ actual = redis . xadd ( 's1' , { f1 : 'v1' , f2 : 'v2' } , nomkstream : true )
96
+ assert_nil actual
97
+
98
+ actual = redis . xadd ( 's1' , { f1 : 'v1' , f2 : 'v2' } , nomkstream : false )
99
+ assert_match ENTRY_ID_FORMAT , actual
100
+ end
101
+
93
102
def test_xadd_with_invalid_arguments
94
103
assert_raises ( TypeError ) { redis . xadd ( nil , { } ) }
95
104
assert_raises ( Redis ::CommandError ) { redis . xadd ( '' , { } ) }
@@ -647,7 +656,7 @@ def test_xclaim_with_invalid_arguments
647
656
end
648
657
649
658
def test_xautoclaim
650
- omit_version ( MIN_REDIS_VERSION_XAUTOCLAIM )
659
+ omit_version ( '6.2.0' )
651
660
652
661
redis . xadd ( 's1' , { f : 'v1' } , id : '0-1' )
653
662
redis . xgroup ( :create , 's1' , 'g1' , '$' )
@@ -664,7 +673,7 @@ def test_xautoclaim
664
673
end
665
674
666
675
def test_xautoclaim_with_justid_option
667
- omit_version ( MIN_REDIS_VERSION_XAUTOCLAIM )
676
+ omit_version ( '6.2.0' )
668
677
669
678
redis . xadd ( 's1' , { f : 'v1' } , id : '0-1' )
670
679
redis . xgroup ( :create , 's1' , 'g1' , '$' )
@@ -680,7 +689,7 @@ def test_xautoclaim_with_justid_option
680
689
end
681
690
682
691
def test_xautoclaim_with_count_option
683
- omit_version ( MIN_REDIS_VERSION_XAUTOCLAIM )
692
+ omit_version ( '6.2.0' )
684
693
685
694
redis . xadd ( 's1' , { f : 'v1' } , id : '0-1' )
686
695
redis . xgroup ( :create , 's1' , 'g1' , '$' )
@@ -697,7 +706,7 @@ def test_xautoclaim_with_count_option
697
706
end
698
707
699
708
def test_xautoclaim_with_larger_interval
700
- omit_version ( MIN_REDIS_VERSION_XAUTOCLAIM )
709
+ omit_version ( '6.2.0' )
701
710
702
711
redis . xadd ( 's1' , { f : 'v1' } , id : '0-1' )
703
712
redis . xgroup ( :create , 's1' , 'g1' , '$' )
@@ -713,7 +722,7 @@ def test_xautoclaim_with_larger_interval
713
722
end
714
723
715
724
def test_xautoclaim_with_deleted_entry
716
- omit_version ( MIN_REDIS_VERSION_XAUTOCLAIM )
725
+ omit_version ( '6.2.0' )
717
726
718
727
redis . xadd ( 's1' , { f : 'v1' } , id : '0-1' )
719
728
redis . xgroup ( :create , 's1' , 'g1' , '$' )
0 commit comments