@@ -20,8 +20,10 @@ func NewCommandAssertion(expectedCommand string, expectedArgs ...string) RESPAss
2020}
2121
2222func (a CommandAssertion ) Run (value resp_value.Value ) error {
23- if value .Type != resp_value .ARRAY {
24- return fmt .Errorf ("Expected array type, got %s" , value .Type )
23+ arrayTypeAssertion := DataTypeAssertion {ExpectedType : resp_value .ARRAY }
24+
25+ if err := arrayTypeAssertion .Run (value ); err != nil {
26+ return err
2527 }
2628
2729 elements := value .Array ()
@@ -30,8 +32,8 @@ func (a CommandAssertion) Run(value resp_value.Value) error {
3032 return fmt .Errorf ("Expected array with at least 1 element, got %d elements" , len (elements ))
3133 }
3234
33- if elements [0 ].Type != resp_value .SIMPLE_STRING && elements [ 0 ]. Type != resp_value . BULK_STRING {
34- return fmt .Errorf ("Expected first array element to be a string, got %s" , elements [0 ].Type )
35+ if elements [0 ].Type != resp_value .BULK_STRING {
36+ return fmt .Errorf ("Expected first array element to be a bulk string, got %s" , elements [0 ].Type )
3537 }
3638
3739 command := elements [0 ].String ()
@@ -46,8 +48,8 @@ func (a CommandAssertion) Run(value resp_value.Value) error {
4648
4749 for i , expectedArg := range a .ExpectedArgs {
4850 actualArg := elements [i + 1 ]
49- if actualArg .Type != resp_value .SIMPLE_STRING && actualArg . Type != resp_value . BULK_STRING {
50- return fmt .Errorf ("Expected argument %d to be a string, got %s" , i + 1 , actualArg .Type )
51+ if actualArg .Type != resp_value .BULK_STRING {
52+ return fmt .Errorf ("Expected argument %d to be a bulk string, got %s" , i + 1 , actualArg .Type )
5153 }
5254
5355 if actualArg .String () != expectedArg {
0 commit comments